Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm test: [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Disconnected (1 times), because no message in 10000 ms. #82

Closed
tja4472 opened this issue Apr 23, 2016 · 8 comments
Labels

Comments

@tja4472
Copy link
Contributor

tja4472 commented Apr 23, 2016

Thanks for your work.

Needed to edit karma.config.js to allow npm test to complete.

`module.exports = function(config) {

  'use strict';
  config.set({
    browserNoActivityTimeout: 60000, // Note: default value (10000) is not enough`

Actual error:

C:\VSCode\Ionic2\github\clicker>npm test

> [email protected] test C:\VSCode\Ionic2\github\clicker
> gulp --gulpfile test/gulpfile.ts --cwd ./ unit-test

[15:27:43] Requiring external module ts-node/register
[15:27:54] sourced Ionic's gulpfile @ C:\VSCode\Ionic2\github\clicker\gulpfile.js
[15:27:54] Using gulpfile C:\VSCode\Ionic2\github\clicker\test\gulpfile.ts
[15:27:54] Starting 'unit-test'...
[15:27:54] Starting 'clean-test'...
[15:27:54] Starting 'html'...
[15:27:54] Starting 'lint'...
[15:27:54] Starting 'patch-app'...
[15:27:54] node_modules\ionic-angular\decorators\app.js has been backed up to node_modules\ionic-angular\decorators\app.backup
[15:27:54] node_modules\ionic-angular\decorators\app.js has been patched with test/app.stub.js
[15:27:54] Finished 'patch-app' after 30 ms
[15:27:56] Deleted C:\VSCode\Ionic2\github\clicker\www\build\test
[15:27:56] Finished 'clean-test' after 1.82 s
[15:27:56] Finished 'html' after 2.62 s
[15:27:57] Finished 'lint' after 2.88 s
[15:27:57] Starting 'build-unit'...
[15:28:14] Starting 'restore-app'...
[15:28:14] node_modules\ionic-angular\decorators\app.backup has been restored to node_modules\ionic-angular\decorators\app.js
[15:28:14] Finished 'restore-app' after 3.74 ms
[15:28:14] Finished 'build-unit' after 17 s
[15:28:14] Starting 'karma'...

START:
23 04 2016 15:28:17.906:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
23 04 2016 15:28:17.918:INFO [launcher]: Starting browser PhantomJS
23 04 2016 15:28:23.626:INFO [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Connected on socket /#3uz5hNuTqjXdQYcLAAAA with id 13020248
23 04 2016 15:28:33.630:WARN [PhantomJS 2.1.1 (Windows 8 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.

Finished in 10.006 secs / 0 secs

[15:28:33] 'karma' errored after 19 s
[15:28:33] Error: 1
    at formatError (C:\VSCode\Ionic2\github\clicker\node_modules\gulp\bin\gulp.js:169:10)
    at Gulp.<anonymous> (C:\VSCode\Ionic2\github\clicker\node_modules\gulp\bin\gulp.js:195:15)
    at emitOne (events.js:82:20)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (C:\VSCode\Ionic2\github\clicker\node_modules\orchestrator\index.js:264:8)
    at C:\VSCode\Ionic2\github\clicker\node_modules\orchestrator\index.js:275:23
    at finish (C:\VSCode\Ionic2\github\clicker\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (C:\VSCode\Ionic2\github\clicker\node_modules\orchestrator\lib\runTask.js:29:3)
    at removeAllListeners (C:\VSCode\Ionic2\github\clicker\node_modules\karma\lib\server.js:336:7)
    at Server.<anonymous> (C:\VSCode\Ionic2\github\clicker\node_modules\karma\lib\server.js:347:9)
    at Server.g (events.js:260:16)
    at emitNone (events.js:72:20)
    at Server.emit (events.js:166:7)
    at emitCloseNT (net.js:1521:8)
    at nextTickCallbackWith1Arg (node.js:431:9)
    at process._tickCallback (node.js:353:17)
[15:28:33] 'unit-test' errored after 40 s
[15:28:33] Error in plugin 'run-sequence'
Message:
    An error occured in task 'karma'.
npm ERR! Test failed.  See above for more details.
@lathonez
Copy link
Owner

Hey, thanks for raising this.

I decreased the value in my own setup to 1000 to replicate the issue.

Note totally sure what to do about this - it's clearly system specific. I'm hesitant to bump it to 60 as this seems very long.

At the same time I'd like to get a value which is working for the vast majority if users.

Did you have a play with it to find a minimum viable value?

The other option is just keeping this for reference, maybe adding the config in karma.config.js commented with a reference to the error?

Interested to hear your view on it.

Cheers.

@ValterSantosMatos
Copy link

Hi,

As feedback, I had the same issue, 20000 did not worked, 30000 did.

Keep the good work,
Valter

@tja4472
Copy link
Contributor Author

tja4472 commented Apr 25, 2016

Hi

I agree with Valter. 30000 worked. 20000 didn't.

I'm using Windows 10.

Happy with a comment in karma.config.js.

Regards
Tim

@clown-0726
Copy link

I was not working for me, I have tried to set that param with 60000 or 30000 , then it also showed that error below.

I do need one of ur guys favor. Thx.

ERROR: 'Error: undefined is not an object (evaluating '$state.$current')
http://localhost:9876/base/src/lib/angular-ui-router/release/angular-ui-router.js?70adc44a1c0900df9b
1c88bc6cfb9bc9917955c6:2382:19
invoke@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734c
9:4718:24
handleIfMatch@http://localhost:9876/base/src/lib/angular-ui-router/release/angular-ui-router.js?70ad
c44a1c0900df9b1c88bc6cfb9bc9917955c6:1868:34
http://localhost:9876/base/src/lib/angular-ui-router/release/angular-ui-router.js?70adc44a1c0900df9b
1c88bc6cfb9bc9917955c6:1925:31
check@http://localhost:9876/base/src/lib/angular-ui-router/release/angular-ui-router.js?70adc44a1c09
00df9b1c88bc6cfb9bc9917955c6:2041:27
update@http://localhost:9876/base/src/lib/angular-ui-router/release/angular-ui-router.js?70adc44a1c0
900df9b1c88bc6cfb9bc9917955c6:2050:18
$broadcast@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75
734c9:18005:33
afterLocationChange@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d7
7e4438b75734c9:13764:28
http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734c9:13750
:32
$eval@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734c9
:17682:28
$digest@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734
c9:17495:36
$apply@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734c
9:17790:31
bootstrapApply@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e443
8b75734c9:1761:21
invoke@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734c
9:4718:24
doBootstrap@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b7
5734c9:1759:20
bootstrap@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b757
34c9:1779:23
http://localhost:9876/base/src/startup.js?8a047b291ef990492cf2279d0765f1de143d9f87:6:26
trigger@http://localhost:9876/base/src/lib/angular/angular.js?91a3bb819177d2c8e865c486d77e4438b75734
c9:3207:9'
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 8 of 8 SUCCESS (0.023 secs / 0.082 secs)
30 09 2016 13:54:20.832:WARN [web-server]: 404: /login/sessionValidate
30 09 2016 13:54:20.834:WARN [web-server]: 404: /login/sessionValidate
[13:54:21] Finished 'unit-test' after 5.75 s
30 09 2016 13:54:50.828:WARN [PhantomJS 2.1.1 (Windows 7 0.0.0)]: Disconnected (1 times), because no
PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
  Disconnected, because no message in 30000 ms.
PhantomJS 2.1.1 (Windows 7 0.0.0): Executed 8 of 8 DISCONNECTED (30.047 secs / 0.082 secs)
[13:54:50] 'unit-test' errored after 35 s
[13:54:50] Error: 1
    at formatError (Q:\Users\a582123\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^3.7.0\
formatError.js:20:10)
    at Gulp.<anonymous> (Q:\Users\a582123\AppData\Roaming\npm\node_modules\gulp-cli\lib\versioned\^3
.7.0\log\events.js:41:15)
    at emitOne (events.js:77:13)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (Q:\Users\a582123\Documents\nextetc\node_modules\orchestrator
\index.js:264:8)
    at Q:\Users\a582123\Documents\nextetc\node_modules\orchestrator\index.js:275:23
    at finish (Q:\Users\a582123\Documents\nextetc\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (Q:\Users\a582123\Documents\nextetc\node_modules\orchestrator\lib\runTask.js:29:3)
    at removeAllListeners (Q:\Users\a582123\Documents\nextetc\node_modules\karma\lib\server.js:379:7
)
    at Q:\Users\a582123\Documents\nextetc\node_modules\karma\lib\server.js:390:9
    at Server.<anonymous> (net.js:1472:9)
    at Server.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at Server.emit (events.js:166:7)
    at emitCloseNT (net.js:1519:8)
    at nextTickCallbackWith1Arg (node.js:431:9)

@lathonez
Copy link
Owner

Can't see how it's related.

Seems your issue is that the state variable is undefined:

ERROR: 'Error: undefined is not an object (evaluating '$state.$current')

If you are reproducing this error on our repo please raise an issue. If the error isn't against our repo we'll need a reproduction scenario (in a new issue) to be able to help.

@clown-0726
Copy link

That problem have produced many times. As you said, I think this issue maybe causing as you mentioned.

But I also want you kindly give me some tips which I can be using to solve my problem. Thx a lot.

@Prasannajnaeyulu
Copy link

I set the timeout to 60000
browserNoActivityTimeout: 60000
and it started working fine

@ravimallya
Copy link

I also had the same issue. changed the timeout to 12000 and able to run. Not sure what causing. Windows 10, i5 with 12 gb of ram.

`husky > npm run -s prepush (node v8.9.4)

10% building modules 1/1 modules 0 active16 03 2018 21:10:53.500:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
16 03 2018 21:10:53.504:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
16 03 2018 21:10:53.512:INFO [launcher]: Starting browser PhantomJS 16 03 2018 21:11:01.861:INFO [PhantomJS 2.1.1 (Windows 8.0.0)]: Connected on socket pixdBJifXVk_zoCkAAAA with id 42352254
PhantomJS 2.1.1 (Windows 8.0.0): Executed 0 of 4 SUCCESS (0 secs / 0 secs)
PhantomJS 2.1.1 (Windows 8.0.0) ERROR
Disconnected, because no message in 60000 ms.
PhantomJS 2.1.1 (Windows 8.0.0): Executed 0 of 4 DISCONNECTED (1 min 0.002 secs / 0 secs)
PhantomJS 2.1.1 (Windows 8.0.0) ERROR
PhantomJS 2.1.1 (Windows 8.0.0): Executed 0 of 4 DISCONNECTED (1 min 0.002 secs / 0 secs`

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

No branches or pull requests

6 participants