Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

global copy of phantomjs not found in 1.0.4 #168

Open
silvioboehme opened this issue Mar 10, 2017 · 4 comments
Open

global copy of phantomjs not found in 1.0.4 #168

silvioboehme opened this issue Mar 10, 2017 · 4 comments

Comments

@silvioboehme
Copy link

Hi!

Version 1.0.4 doesn't work with a global install of phantomjs.
Here is a short log of the npm install:

phantomjs-prebuilt@2.1.14 install D:\a\1\s\node_modules\phantomjs-prebuilt
node install.js

Considering PhantomJS found at C:\NPM\Modules\phantomjs.CMD
C:\NPM\Modules\phantomjs.CMD ...verifying
Writing location.js file
PhantomJS is already installed on PATH at C:\NPM\Modules\phantomjs.CMD

As is see you take phantomPackage._location (/phantomjs-prebuilt) instead of /phantomjs.
The provided CMD file points to the EXE file, but not necessary in your hardcoded folder.
It is unsafe to locate the EXE based from the CMD path.

The build-server (VSTS) was setup with your old path to the EXE, to workaround this problem.
Now all VSTS build with karma-phantomjs-launcher are broken.

I haven't a solution for this...rollback the to version 1.0.2 or start phantomjs via CMD.
:-(
Silvio

@silvioboehme
Copy link
Author

VSTS is Visual Studio Team Services

@floyd-may
Copy link

This was a problem for me as well. Ate up a couple days of my time. I also had to roll back to version 1.0.2 in order to get my VSTS builds working again. The only way I was able to figure it out was to diff the exact versions of the NPM modules installed between a passing build and a failing build.

I'm a little surprised that there wasn't more specific / useful error information about this with the logging set to DEBUG. Here are the relevant logs from my VSTS build when this failed:

DEBUG [config]: Loading config C:\a\1\s\...\karma.conf.js
DEBUG [plugin]: Loading karma-* from C:\a\1\s\...\node_modules
DEBUG [plugin]: Loading plugin C:\a\1\s\...\node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin C:\a\1\s\...\node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin C:\a\1\s\...\node_modules/karma-spec-reporter.
DEBUG [web-server]: Instantiating middleware
DEBUG [reporter]: Trying to load reporter: spec
DEBUG [reporter]: Trying to load color-version of reporter: spec (spec_color)
DEBUG [reporter]: Couldn't load color-version.
INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9876/
INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at C:\Users\BUILDG~1\AppData\Local\Temp\karma-68217745
DEBUG [launcher]: C:\NPM\Modules\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs C:\Users\BUILDG~1\AppData\Local\Temp\karma-68217745/capture.js
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
WARN [launcher]: PhantomJS was not killed in 2000 ms, sending SIGKILL.
WARN [launcher]: PhantomJS was not killed by SIGKILL in 2000 ms, continuing.
DEBUG [launcher]: Process PhantomJS exited with code -1
DEBUG [temp-dir]: Cleaning temp dir C:\Users\BUILDG~1\AppData\Local\Temp\karma-68217745
DEBUG [launcher]: PhantomJS failed (timeout). Not restarting.
DEBUG [karma]: Run complete, exiting.
DEBUG [launcher]: Disconnecting all browsers

@BrianMikinski
Copy link

BrianMikinski commented Mar 20, 2017

@silvioboehme I was coming across this same issue and found that if I change the Default Agent Queue in the Options section of my build that the Karma unit tests start working again. Not sure if that is an option for you but the new VS2017 build host doesn't seem to have this same issue -
image

@silvioboehme
Copy link
Author

@BrianMikinski Thank you for this tip.
I have changed all my agents to "Hosted 2017" because we need this for our VS2017 backend.

Now Karma-phantomjs-launcher 1.0.4 works fine.
The difference is, that the "Hosted 2017" Agent doesn't have phantomjs preinstalled.
On this agent phantomjs prebuild is downloaded in the npm install step.

I hope it stays that way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants