Reproduced on this test.js:
function wait(millis) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + millis) {}
}
describe("suite", function () {
it("wait 1 sec", function () {
wait(1000);
});
it("wait 11 sec", function () {
wait(11000);
});
it("wait 1 sec again", function () {
wait(1000);
});
});
Test wait 11 sec takes 11 sec to execute, so the browser is disconnected:
WARN [Chrome 38.0.2125 (Linux)]: Disconnected (1 times), because no message in 10000 ms.
The problem is that, for some reason, onSpecComplete is called after onRunComplete.
Is it expected or a bug?
This is a bug and mentioned somewhere else I just can't find the issue right now.
This should be fixed by https://github.com/karma-runner/karma/commit/9c894f9eab19945b2c4355874d63854eb1c8ede7
nice @dignifiedquire!
@dignifiedquire I still seem to be getting this intermittently. :/
Fixed for me on version 1.2.0 :tada:
Should this now be closed?
_Edit:_ Actually, we are still getting this intermittently too.
Still seeing it here - [email protected] and [email protected]
The karma-junit-reporter problem should be fixed in the 1.2.0 release of karma-junit-reporter, but this problem at its root is still present it sounds like.
Still getting the issue in onBrowserComplete, left a note in https://github.com/karma-runner/karma-junit-reporter/issues/61
Most helpful comment
Still seeing it here - [email protected] and [email protected]