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

Successful tests are marked as failed because of DISCONNECTED #95

Closed
d6u opened this issue Jul 15, 2016 · 7 comments
Closed

Successful tests are marked as failed because of DISCONNECTED #95

d6u opened this issue Jul 15, 2016 · 7 comments

Comments

@d6u
Copy link

d6u commented Jul 15, 2016

Chrome 51.0.2704 (Windows 10 0.0.0): Executed 21 of 21 DISCONNECTED (14.456 secs / 4.149 secs)
Firefox 47.0.0 (Windows 10 0.0.0): Executed 21 of 21 DISCONNECTED (14.419 secs / 4.128 secs)
Safari 9.0.0 (Mac OS X 10.11.0): Executed 21 of 21 SUCCESS (4.996 secs / 4.118 secs)
Safari 8.0.8 (Mac OS X 10.10.5): Executed 21 of 21 SUCCESS (4.349 secs / 4.079 secs)
Edge 13.10586.0 (Windows 10 0.0.0): Executed 21 of 21 DISCONNECTED (14.333 secs / 4.073 secs)
IE 11.0.0 (Windows 8.1 0.0.0): Executed 21 of 21 DISCONNECTED (14.91 secs / 4.05 secs)
IE 10.0.0 (Windows 8 0.0.0): Executed 21 of 21 SUCCESS (4.308 secs / 4.051 secs)
IE 9.0.0 (Windows 7 0.0.0): Executed 21 of 21 SUCCESS (4.286 secs / 4.029 secs)
Mobile Safari 7.0.0 (iOS 7.1.0): Executed 21 of 21 SUCCESS (4.312 secs / 4.051 secs)

While running the tests, I often see something like this:

15 07 2016 10:26:30.397:WARN [IE 10.0.0 (Windows 8 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
IE 10.0.0 (Windows 8 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.
15 07 2016 10:26:30.397:INFO [karma]: Restarting IE 10.0.0 (Windows 8 0.0.0) (1 of 3 attempts)

But IE tests has already passed before this message.

Let me know how I can provide more information.

This is my dependencies:

@cecilia-sanare
Copy link

So after a few days of messing around, I've come to realize that various browsers will fail to stop if you use any form of code coverage.

isparta-loader, babel-plugin-istanbul, etc. all cause Edge 14, Safari 9, and Safari 8 to hang on Sauce Labs.

@janmeier
Copy link

Thank you @nick-woodward ! Spent 3 hours trying to figure out why my tests wouldn't finish in safari - Turns out it wasn't my tests after all ...

@jlmakes
Copy link

jlmakes commented Feb 1, 2017

Can't believe I didn't search this repository sooner. I had narrowed it down to the most perplexing lines of code, and couldn't understand what was going wrong. My cousin began to joke that I had actually died and was stuck in purgatory, working on the same bug forever.

It was the instanbul plugin I was using. My solution was to create a separate task for generating code coverage. All good again!

@aore
Copy link

aore commented Apr 3, 2017

This error is still happening even though I've removed my code coverage tools. My errors look like this:

Chrome 55.0.2883 (Mac OS X 10.9.5): Executed 4 of 86 SUCCESS (0.432 secs / 0.437 secs)
03 04 2017 11:37:48.491:INFO [launcher]: Starting browser chrome 56 (OS X 10.9) on SauceLabs
03 04 2017 11:37:58.443:WARN [Chrome 55.0.2883 (Mac OS X 10.9.5)]: Disconnected (1 times), because no message in 10000 ms.
Chrome 55.0.2883 (Mac OS X 10.9.5) ERROR
  Disconnected, because no message in 10000 ms.
Chrome 55.0.2883 (Mac OS X 10.9.5): Executed 4 of 86 DISCONNECTED (10.44 secs / 0.437 secs)
03 04 2017 11:37:58.450:ERROR [reporter.sauce]: ✖ Test Disconnected

With concurrency: 1, tests in Chrome 55 pass, then Chrome 56 starts, and then Chrome 55 returns an error due to disconnecting. Similarly, Chrome 54 has a disconnect error after its tests pass and Chrome 55 starts, and Chrome 56 passes with no disconnect error. Chrome 55 should disconnect after it passes, right? Why is this an error?

I'm testing Chrome 54-56. When I set concurrency: 5, only Chrome 56 fails due to disconnection. Odd behavior.

Does anyone know other solutions?

@amejiarosario
Copy link

I had the same error on PhantomJS: Disconnected, because no message in 10000 ms.

Running "karma:devices" (karma) task
13 04 2017 11:01:24.016:WARN [karma]: Port 9000 in use
13 04 2017 11:01:24.016:INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9001/
13 04 2017 11:01:24.017:INFO [launcher]: Launching browser PhantomJS with unlimited concurrency
13 04 2017 11:01:24.019:INFO [launcher]: Starting browser PhantomJS
13 04 2017 11:01:24.648:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket vforZtAKMlYDTA6QAAAB with id 37867211
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 60 of 997 (skipped 2) SUCCESS (0 secs / 1.34 secs)
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 61 of 997 (skipped 2) SUCCESS (0 secs / 1.417 secs)
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 62 of 997 (skipped 2) SUCCESS (0 secs / 1.448 secs)
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 62 of 997 (skipped 2) SUCCESS (0 secs / 1.448 secs)
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 62 of 997 (skipped 2) SUCCESS (0 secs / 1.448 secs)
WARN: 'Automatically scrolling cursor into view after selection change', 'this will be disabled in the next version', 'set editor.$blockScrolling = Infinity to disable this message'
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 63 of 997 (skipped 2) SUCCESS (0 secs / 1.48 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 112 of 997 (skipped 2) SUCCESS (0 secs / 2.537 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 1028 of 1035 (skipped 7) DISCONNECTED (34.626 secs / 23.849 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 1028 of 1035 (skipped 7) DISCONNECTED (34.626 secs / 23.849 secs)
----------|----------|----------|----------|----------|----------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
----------|----------|----------|----------|----------|----------------|
All files |      100 |      100 |      100 |      100 |                |
----------|----------|----------|----------|----------|----------------|


==================== Coverage / Threshold summary =============================
Statements   : 84.7% ( 5968/7046 ) Threshold : 84%
Branches     : 74.55% ( 1772/2377 ) Threshold : 74%
Functions    : 77.78% ( 1456/1872 ) Threshold : 75%
Lines        : 84.88% ( 5956/7017 ) Threshold : 84%
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 123 of 997 (skipped 2) SUCCESS (0 secs / 2.912 secs)
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.

@rbong
Copy link

rbong commented May 19, 2017

I did not find @nick-woodward 's comment to be accurate.
babel-plugin-istanbul works if you disable source maps. Here is an example config. Paths have been modified because they were absolute. Note devtool: '' and sourceMap: false.

var config = {
  basePath: "",
  frameworks: [
    "mocha",
    "chai"
  ],
  files: [
    "src/**/*.js"
  ],
  exclude: [],
  preprocessors: {
    "src/**/*.js": [
      "webpack"
    ]
  },
  webpack: {
    module: {
      rules: [
        {
          test: /\.js$/,
          include: "src",
          use: {
            loader: "babel-loader",
            options: {
              sourceMap: false,
              presets: [
                "env",
                "stage-2",
                "flow"
              ],
              plugins: [
                "transform-runtime",
                [
                  "istanbul",
                  {
                    exclude: "**/*.spec.js"
                  }
                ]
              ]
            }
          }
        }
      ]
    },
    plugins: [],
    resolve: {
      extensions: [
        ".js"
      ],
      alias: {
        "@src": "src"
      }
    },
    devtool: ""
  },
  webpackMiddleware: {
    stats: "errors-only"
  },
  mochaReporter: {
    showDiff: true
  },
  coverageReporter: {
    dir: "coverage",
    reporters: [
      {
        type: "text-summary"
      }
    ],
    check: {
      global: {
        statements: 90,
        lines: 90,
        functions: 90,
        branches: 90
      }
    }
  },
  customLaunchers: {
    "sauce_ie": {
      base: "SauceLabs",
      browserName: "internet explorer",
      platform: "Windows 8.1",
      version: "11"
    }
  },
  captureTimeout: 120000,
  browserNoActivityTimeout: 120000,
  sauceLabs: {
    testName: "sauce example"
  },
  reporters: [
    "mocha",
    "coverage",
    "saucelabs"
  ],
  port: 9876,
  colors: true,
  autoWatch: true,
  concurrency: Infinity,
  browsers: [
    "sauce_ie"
  ]
};

@wswebcreation
Copy link
Collaborator

Closing this due to inactivity, please try the newest version of this module and feel free to open a new issue if you still experience this issue

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

No branches or pull requests

8 participants