karma icon indicating copy to clipboard operation
karma copied to clipboard

Using browserDisconnectTolerance invalidates test suite

Open kirahowe opened this issue 6 years ago • 4 comments

Expected behaviour

When a test fails, karma says that the test failed.

Actual behaviour

When a test fails and chrome disconnects then reconnects (which is allowed if the browserDisconnectTolerance is set to something greater than 0), karma will only report the results of the tests that have run since reconnecting, ignoring any test failures from before chrome disconnected.

Environment Details

  • Karma version (output of karma --version): 1.7.1
  • Relevant part of your karma.config.js file:
    browserDisconnectTolerance: 1

Steps to reproduce the behaviour

  1. Set browserDisconnectTolerance to anything greater than 0.
  2. Run a test that fails before the browser disconnects, then after reconnecting run a test that passes
  3. Expected: The build should fail and karma should report the test failure from before the disconnection Actual: The build passes because karma only reports the results of tests run since the reconnection

kirahowe avatar Jul 16 '18 18:07 kirahowe

What is the easiest way to reproduce browser disconnection ?

lusarz avatar Aug 10 '18 13:08 lusarz

You can try setting the option introduced in #3102 to 1ms. Otherwise I guess you have to create a special test client.html that drops the connection.

johnjbarton avatar Aug 10 '18 15:08 johnjbarton

Have the same problem here. Karma doesn't report any tests that were run before the timeout.

SayWhat69 avatar Jun 11 '19 12:06 SayWhat69

Same here. Doesn't this issue make browserDisconnectTolerance completely useless?

M1ghty1 avatar Jun 12 '19 06:06 M1ghty1