Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 因果报应错误-Chrome在60000毫秒内未捕获,导致死亡_Angularjs_Unit Testing_Karma Runner_Karma Jasmine - Fatal编程技术网

Angularjs 因果报应错误-Chrome在60000毫秒内未捕获,导致死亡

Angularjs 因果报应错误-Chrome在60000毫秒内未捕获,导致死亡,angularjs,unit-testing,karma-runner,karma-jasmine,Angularjs,Unit Testing,Karma Runner,Karma Jasmine,调试日志: E:\Projects\abb\Projects\WebApp\abb.web>karma start DEBUG [plugin]: Loading karma-* from E:\Projects\abb\Projects\WebApp\abb .web\node_modules DEBUG [plugin]: Loading plugin E:\Projects\abb\Projects\WebApp\abb.web\n ode_modules/karma-chrome-

调试日志:

E:\Projects\abb\Projects\WebApp\abb.web>karma start
DEBUG [plugin]: Loading karma-* from E:\Projects\abb\Projects\WebApp\abb
.web\node_modules
DEBUG [plugin]: Loading plugin E:\Projects\abb\Projects\WebApp\abb.web\n
ode_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin E:\Projects\abb\Projects\WebApp\abb.web\n
ode_modules/karma-jasmine.
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [watcher]: Resolved files:
        E:/Projects/abb/Projects/WebApp/abb.web/node_modules/karma-jasmi
ne/lib/jasmine.js
        E:/Projects/abb/Projects/WebApp/abb.web/node_modules/karma-jasmi
ne/lib/adapter.js
        E:/Projects/abb/Projects/WebApp/abb.web/app/js/vendor/angular.js

        E:/Projects/abb/Projects/WebApp/abb.web/app/js/vendor/angular-ro
ute.js
        E:/Projects/abb/Projects/WebApp/abb.web/test/lib/angular-mocks.j
s
        E:/Projects/abb/Projects/WebApp/abb.web/app/js/app.debug.js
        E:/Projects/abb/Projects/WebApp/abb.web/test/unit/homepage.spec.
js
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/9uv4dB4yQPjZ7sZcWUuH
DEBUG [karma]: A browser has connected on socket 9uv4dB4yQPjZ7sZcWUuH
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
INFO [launcher]: Trying to start Chrome again (1/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/ei81-LVHlsfeDeCXWUuI
DEBUG [karma]: A browser has connected on socket ei81-LVHlsfeDeCXWUuI
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
INFO [launcher]: Trying to start Chrome again (2/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/rpgHU0_UF1MnvCwCWUuJ
DEBUG [karma]: A browser has connected on socket rpgHU0_UF1MnvCwCWUuJ
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
// Karma configuration
// Generated on Sat May 24 2014 22:34:35 GMT+0530 (India Standard Time)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],


    // list of files / patterns to load in the browser
    files: [
        'app/js/vendor/angular.js',
        'app/js/vendor/angular-route.js',
        'test/lib/angular-mocks.js',
        'app/js/app.debug.js',
        'test/unit/**/*.spec.js'
    ],


    // list of files to exclude
    exclude: [

    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {

    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_DEBUG,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};
软件包版本: 节点版本:v0.10.28

"karma": "^0.12.16",
"karma-chrome-launcher": "^0.1.4",
"karma-jasmine": "^0.1.5",
配置文件:

E:\Projects\abb\Projects\WebApp\abb.web>karma start
DEBUG [plugin]: Loading karma-* from E:\Projects\abb\Projects\WebApp\abb
.web\node_modules
DEBUG [plugin]: Loading plugin E:\Projects\abb\Projects\WebApp\abb.web\n
ode_modules/karma-chrome-launcher.
DEBUG [plugin]: Loading plugin E:\Projects\abb\Projects\WebApp\abb.web\n
ode_modules/karma-jasmine.
INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [watcher]: Resolved files:
        E:/Projects/abb/Projects/WebApp/abb.web/node_modules/karma-jasmi
ne/lib/jasmine.js
        E:/Projects/abb/Projects/WebApp/abb.web/node_modules/karma-jasmi
ne/lib/adapter.js
        E:/Projects/abb/Projects/WebApp/abb.web/app/js/vendor/angular.js

        E:/Projects/abb/Projects/WebApp/abb.web/app/js/vendor/angular-ro
ute.js
        E:/Projects/abb/Projects/WebApp/abb.web/test/lib/angular-mocks.j
s
        E:/Projects/abb/Projects/WebApp/abb.web/app/js/app.debug.js
        E:/Projects/abb/Projects/WebApp/abb.web/test/unit/homepage.spec.
js
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/9uv4dB4yQPjZ7sZcWUuH
DEBUG [karma]: A browser has connected on socket 9uv4dB4yQPjZ7sZcWUuH
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
INFO [launcher]: Trying to start Chrome again (1/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/ei81-LVHlsfeDeCXWUuI
DEBUG [karma]: A browser has connected on socket ei81-LVHlsfeDeCXWUuI
WARN [launcher]: Chrome have not captured in 60000 ms, killing.
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
INFO [launcher]: Trying to start Chrome again (2/2).
DEBUG [launcher]: Restarting Chrome
DEBUG [temp-dir]: Creating temp dir at C:\Users\Kunal\AppData\Local\Temp\karma-8
6563066
DEBUG [launcher]: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --
user-data-dir=C:\Users\Kunal\AppData\Local\Temp\karma-86563066 --no-default-brow
ser-check --no-first-run --disable-default-apps --disable-popup-blocking --disab
le-translate http://localhost:9876/?id=86563066
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/client.html
DEBUG [web-server]: serving: E:\Projects\abb\Projects\WebApp\abb.web\nod
e_modules\karma\static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/rpgHU0_UF1MnvCwCWUuJ
DEBUG [karma]: A browser has connected on socket rpgHU0_UF1MnvCwCWUuJ
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Process Chrome exited with code 0
DEBUG [temp-dir]: Cleaning temp dir C:\Users\Kunal\AppData\Local\Temp\karma-8656
3066
// Karma configuration
// Generated on Sat May 24 2014 22:34:35 GMT+0530 (India Standard Time)

module.exports = function(config) {
  config.set({

    // base path that will be used to resolve all patterns (eg. files, exclude)
    basePath: '',


    // frameworks to use
    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
    frameworks: ['jasmine'],


    // list of files / patterns to load in the browser
    files: [
        'app/js/vendor/angular.js',
        'app/js/vendor/angular-route.js',
        'test/lib/angular-mocks.js',
        'app/js/app.debug.js',
        'test/unit/**/*.spec.js'
    ],


    // list of files to exclude
    exclude: [

    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {

    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_DEBUG,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: false,


    // start these browsers
    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
    browsers: ['Chrome'],


    // Continuous Integration mode
    // if true, Karma captures browsers, runs the tests and exits
    singleRun: false
  });
};
Chrome将以localhost://9876 并显示“因果报应开始”

无法使业力发挥作用。请帮忙


我已尝试设置autowatch:true并禁用防火墙,但这些都不起作用。

我正在visual studio代码终端上执行该命令。当我切换到iTerm时,它突然工作了。

尝试设置一个NO_代理导出,例如:export NO_PROXY=“localhost,0.0.0.0/4201,0.0.0.0/9876”

我的解决方案是将Karma的全局安装更新到最新版本。我怀疑我也可能只是重新安装了现有版本,因为我认为Karma安装已经损坏,因为不管我使用什么浏览器,Karma仍然无法连接到它(或者它无法连接到Karma)。

正如Mikey提到的,设置
NO\u PROXY
对我有效,但是,它不是通过
导出
,但我必须在
karma.conf.js
文件中执行,以便
karma
拾取此环境变量

process.env.NO_PROXY='localhost,0.0.0.0/4201,0.0.0.0/9876'
process.env.no_proxy='localhost,0.0.0.0/4201,0.0.0.0/9876'

希望它能帮助像我这样绝望的人一天….

这对我来说很有用:

1) 安装木偶演员

npm install puppeteer --save-dev
2) 将此代码添加到模块导出函数顶部的karma conf中:

const puppeteer = require('puppeteer');
process.env.CHROME_BIN = puppeteer.executablePath();
3) 禁用chrome沙盒:

browsers: ['ChromeHeadlessCI'],
customLaunchers: {
    ChromeHeadlessCI: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox']
    }
}

显然因果报应文件被破坏了,这对我有帮助:

  • 完全删除
    节点模块
    文件夹
  • 运行
    npm安装

  • 另一个原因是运行了过时版本的karma和相关软件包(我特别怀疑karma chrome launcher)。

    您是否找到了解决此问题的方法?我得到了完全相同的信息:
    Chrome在60000毫秒内没有捕获,正在杀人。
    No,我切换到PhantomJS。这在我的测试中起了作用。是的,我在构建服务器上也遇到了同样的问题。我原以为这是因为teamcity中的某些东西,但可能只是一个karma/chrome问题。@AlienBishop和dss,你可能遇到了与我相同的问题,因为chrome的最新更新。我在这里为这个问题创建了一个问题:同样的问题在这里,虽然在本地有效,但只在构建服务器(teamcity)上存在问题。不幸的是,这在azure devops上对我不起作用。还有一个错误,chromeheadless无法在60000毫秒内捕获,请问木偶师做了什么?在win server 2019上没有沙箱作为ci对我有效。我可能不需要添加木偶演员,但无论如何,添加木偶演员很好。