javascript - Karma 无法在 Visual Studio Online 上运行 'PhantomJS have not captured in 60000 ms, killing.'

标签 javascript phantomjs karma-runner azure-devops

我们的构建最近停止运行 JavaScript 单元测试,我已经追踪到这个......

2017-04-04T18:24:11.4691955Z [18:24:11] Starting 'karma-server'...
2017-04-04T18:24:22.7975588Z [32m04 04 2017 18:24:22.796:INFO [framework.browserify]: [39mbundle built
2017-04-04T18:24:22.8435587Z [32m04 04 2017 18:24:22.843:INFO [karma]: [39mKarma v1.5.0 server started at http://0.0.0.0:9876/
2017-04-04T18:24:22.8435587Z [32m04 04 2017 18:24:22.843:INFO [launcher]: [39mLaunching browser PhantomJS with unlimited concurrency
2017-04-04T18:24:22.8495591Z [32m04 04 2017 18:24:22.849:INFO [launcher]: [39mStarting browser PhantomJS
2017-04-04T18:25:22.8598561Z [33m04 04 2017 18:25:22.859:WARN [launcher]: [39mPhantomJS have not captured in 60000 ms, killing.
2017-04-04T18:25:24.8616444Z [33m04 04 2017 18:25:24.861:WARN [launcher]: [39mPhantomJS was not killed in 2000 ms, sending SIGKILL.
2017-04-04T18:25:26.8628686Z [33m04 04 2017 18:25:26.861:WARN [launcher]: [39mPhantomJS was not killed by SIGKILL in 2000 ms, continuing.

我已经在这里看过一篇与 TeamCity ( TeamCity: PhantomJS have not captured in 60000 ms, killing ) 有关的类似文章,但那里的建议都没有帮助我 - 如果存在某种版本冲突,我不确定我能做什么关于它,因为它是一个云服务器。

更复杂的是,尝试使用 Chrome 和 Firefox 会导致类似的错误,因此 Karma 似乎根本无法运行。

这是我的 package.json 中的依赖项...

  "devDependencies": {
    "babel-core": "^6.17.0",
    "babel-eslint": "^7.0.0",
    "babel-loader": "^6.2.5",
    "babel-preset-airbnb": "^2.1.1",
    "babel-preset-es2015": "^6.16.0",
    "babel-preset-react": "^6.16.0",
    "babel-preset-stage-0": "^6.16.0",
    "babelify": "7.3.0",
    "bootstrap-sass": "3.3.7",
    "browserify": "^13.1.0",
    "browserify-shim": "^3.8.12",
    "chai": "^3.5.0",
    "enzyme": "^2.7.1",
    "eslint": "^3.7.1",
    "eslint-config-defaults": "^9.0.0",
    "eslint-plugin-react": "^6.4.1",
    "gulp": "^3.9.1",
    "gulp-babel": "^6.1.2",
    "gulp-clean": "^0.3.1",
    "gulp-clean-css": "^2.0.13",
    "gulp-eslint": "^3.0.1",
    "gulp-jshint": "^2.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-sass": "^2.3.2",
    "gulp-sourcemaps": "^2.0.1",
    "gulp-uglify": "^1.2.0",
    "gulp-util": "^3.0.7",
    "jsdom": "^9.6.0",
    "jshint": "^2.9.3",
    "karma": "^1.3.0",
    "karma-browserify": "^5.1.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-firefox-launcher": "^1.0.0",
    "karma-htmlfile-reporter": "^0.3.4",
    "karma-ie-launcher": "^1.0.0",
    "karma-junit-reporter": "^1.1.0",
    "karma-mocha": "^1.2.0",
    "karma-phantomjs-launcher": "^1.0.2",
    "mocha": "^3.1.2",
    "mocha-jsdom": "^1.1.0",
    "phantomjs-polyfill-find": "github:ptim/phantomjs-polyfill-find",
    "react-addons-test-utils": "15.3.2",
    "reactify": "^1.1.1",
    "sinon": "^1.17.6",
    "vinyl-buffer": "^1.0.0",
    "vinyl-source-stream": "^1.1.0",
    "watchify": "^3.7.0",
    "webpack": "^1.13.2"
  },
  "dependencies": {
    "bootbox": "^4.4.0",
    "domready": "^1.0.8",
    "font-awesome": "^4.3.0",
    "google-maps": "^3.2.1",
    "google-maps-react": "^1.0.19",
    "jquery": "^2.2.0",
    "jquery-validation": "^1.15.1",
    "jquery-validation-unobtrusive": "^3.2.6",
    "react": "15.3.2",
    "react-dom": "15.3.2"
  }

这是我的 npm 安装日志中的相关行...

2017-04-04T18:22:19.7856046Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\phantomjs-prebuilt-b964b710
2017-04-04T18:22:19.7916044Z npm verb tar unpack C:\NPM\Cache\karma-phantomjs-launcher\1.0.4\package.tgz
2017-04-04T18:22:19.7916044Z npm verb tar unpacking to C:\a\1\s\node_modules\.staging\karma-phantomjs-launcher-fa85a47b
2017-04-04T18:22:19.7916044Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\karma-phantomjs-launcher-fa85a47b
2017-04-04T18:22:19.7916044Z npm verb tar unpack C:\NPM\Cache\phantomjs-polyfill-find\0.0.1\package.tgz
2017-04-04T18:22:19.7916044Z npm verb tar unpacking to C:\a\1\s\node_modules\.staging\phantomjs-polyfill-find-735c6798
2017-04-04T18:22:19.7916044Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\phantomjs-polyfill-find-735c6798
2017-04-04T18:22:19.9856046Z npm verb tar unpack C:\NPM\Cache\phantomjs-prebuilt\2.1.14\package.tgz
2017-04-04T18:22:19.9856046Z npm verb tar unpacking to C:\a\1\s\node_modules\.staging\phantomjs-prebuilt-b964b710
2017-04-04T18:22:19.9856046Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\phantomjs-prebuilt-b964b710
2017-04-04T18:22:31.3378416Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\phantomjs-polyfill-find-735c6798\node_modules
2017-04-04T18:22:38.0815841Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\karma-phantomjs-launcher-fa85a47b\node_modules
2017-04-04T18:22:38.3575834Z npm verb gentlyRm don't care about contents; nuking C:\a\1\s\node_modules\.staging\phantomjs-prebuilt-b964b710\node_modules
2017-04-04T18:22:57.0642113Z npm info lifecycle karma-phantomjs-launcher@1.0.4~preinstall: karma-phantomjs-launcher@1.0.4
2017-04-04T18:22:57.0642113Z npm info lifecycle mocha@3.2.0~preinstall: mocha@3.2.0
2017-04-04T18:22:57.0642113Z npm info lifecycle mocha-jsdom@1.1.0~preinstall: mocha-jsdom@1.1.0
2017-04-04T18:22:57.0642113Z npm info lifecycle phantomjs-polyfill-find@0.0.1~preinstall: phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:04.8643111Z npm verb link bins   'C:\\a\\1\\s\\node_modules\\phantomjs-prebuilt\\node_modules\\.bin',
2017-04-04T18:23:05.9583107Z npm verb link bins   'C:\\a\\1\\s\\node_modules\\phantomjs-prebuilt\\node_modules\\.bin',
2017-04-04T18:23:06.6253103Z npm info linkStuff phantomjs-prebuilt@2.1.14
2017-04-04T18:23:06.6253103Z npm verb linkBins phantomjs-prebuilt@2.1.14
2017-04-04T18:23:06.6253103Z npm verb link bins [ { phantomjs: './bin/phantomjs' },
2017-04-04T18:23:06.6253103Z npm verb link bins   'C:\\a\\1\\s\\node_modules\\.bin',
2017-04-04T18:23:06.6253103Z npm verb link bins   false ]
2017-04-04T18:23:06.6253103Z npm verb linkMans phantomjs-prebuilt@2.1.14
2017-04-04T18:23:06.6273102Z npm info linkStuff karma-phantomjs-launcher@1.0.4
2017-04-04T18:23:06.6273102Z npm verb linkBins karma-phantomjs-launcher@1.0.4
2017-04-04T18:23:06.6273102Z npm verb linkMans karma-phantomjs-launcher@1.0.4
2017-04-04T18:23:06.6273102Z npm info linkStuff phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:06.6273102Z npm verb linkBins phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:06.6273102Z npm verb linkMans phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:14.5304091Z > phantomjs-prebuilt@2.1.14 install C:\a\1\s\node_modules\phantomjs-prebuilt
2017-04-04T18:23:14.5304091Z > node install.js
2017-04-04T18:23:14.5304091Z 
2017-04-04T18:23:14.9584088Z Considering PhantomJS found at C:\NPM\Modules\phantomjs.CMD
2017-04-04T18:23:14.9584088Z Found PhantomJS at C:\NPM\Modules\phantomjs.CMD ...verifying
2017-04-04T18:23:15.9716075Z Writing location.js file
2017-04-04T18:23:15.9726077Z PhantomJS is already installed on PATH at C:\NPM\Modules\phantomjs.CMD
2017-04-04T18:23:15.9776069Z npm verb lifecycle phantomjs-prebuilt@2.1.14~install: unsafe-perm in lifecycle true
2017-04-04T18:23:15.9776069Z npm verb lifecycle phantomjs-prebuilt@2.1.14~install: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\a\1\s\node_modules\phantomjs-prebuilt\node_modules\.bin;C:\a\1\s\node_modules\.bin;C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.115.0\externals\git\cmd;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4\;C:\Users\VssAdministrator\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\wbin;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\Git LFS;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Python27;C:\Program Files\dotnet\;C:\Program Files (x86)\CMake\bin;C:\NPM\Modules;C:\Program Files\nodejs\;C:\NPM\Modules;C:\cordova;C:\java\ant\apache-ant-1.9.7\bin;C:\NPM\Modules;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\cf-cli_6.25.0_winx64\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.115.0\bin;C:\LR\mms\Services\Mms\Provisioner\TaskAgent\agents\2.115.0\bin
2017-04-04T18:23:15.9776069Z npm verb lifecycle phantomjs-prebuilt@2.1.14~install: CWD: C:\a\1\s\node_modules\phantomjs-prebuilt
2017-04-04T18:23:16.1606071Z npm info lifecycle karma-phantomjs-launcher@1.0.4~install: karma-phantomjs-launcher@1.0.4
2017-04-04T18:23:16.1646061Z npm info lifecycle mocha@3.2.0~install: mocha@3.2.0
2017-04-04T18:23:16.1696061Z npm info lifecycle mocha-jsdom@1.1.0~install: mocha-jsdom@1.1.0
2017-04-04T18:23:16.1736057Z npm info lifecycle phantomjs-polyfill-find@0.0.1~install: phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:20.7936066Z npm info lifecycle phantomjs-prebuilt@2.1.14~postinstall: phantomjs-prebuilt@2.1.14
2017-04-04T18:23:20.9786072Z npm info lifecycle karma-phantomjs-launcher@1.0.4~postinstall: karma-phantomjs-launcher@1.0.4
2017-04-04T18:23:20.9826055Z npm info lifecycle mocha@3.2.0~postinstall: mocha@3.2.0
2017-04-04T18:23:20.9886074Z npm info lifecycle mocha-jsdom@1.1.0~postinstall: mocha-jsdom@1.1.0
2017-04-04T18:23:20.9926063Z npm info lifecycle phantomjs-polyfill-find@0.0.1~postinstall: phantomjs-polyfill-find@0.0.1
2017-04-04T18:23:22.6156057Z +-- karma-phantomjs-launcher@1.0.4 
2017-04-04T18:23:22.6156057Z | `-- phantomjs-prebuilt@2.1.14 

最佳答案

关于javascript - Karma 无法在 Visual Studio Online 上运行 'PhantomJS have not captured in 60000 ms, killing.',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43242889/

相关文章:

javascript - 适用于移动浏览器的 WEBRTC 屏幕捕获 API

Javascript 不从文本编辑器执行

javascript - 内联构建工具提示注释而不是在文档上准备好吗?

javascript - Uncaught ReferenceError : define is not defined

javascript - Karma 单元测试 jsonp 回调中的延迟 promise (stripe.js)

javascript - 在 PHP 和 JavaScript 中打印月份名称而不是月份编号

node.js - heroku 上 phantomjs 的分页内部支持

javascript - 如何将命名参数传递给 phantomjs 文件

javascript - 使用 Selenium 和 PhantomJS 测试 AngularJS 应用程序

ruby-on-rails - AngularJS 和 Rails - e2e 睾丸测试。如何登录用户来测试 Angular 页面?