Karma: Reporter's onSpecComplete is called after onRunComplete

Created on 28 Jan 2015  路  9Comments  路  Source: karma-runner/karma

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?

feedback-from-author bug

Most helpful comment

Still seeing it here - [email protected] and [email protected]

All 9 comments

This is a bug and mentioned somewhere else I just can't find the issue right now.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

charpour picture charpour  路  3Comments

macjohnny picture macjohnny  路  5Comments

simonh1000 picture simonh1000  路  3Comments

schippie picture schippie  路  5Comments

TKTheTechie picture TKTheTechie  路  4Comments