karma-runner / karma-runner/karma

Reporter's onSpecComplete is called after onRunComplete

Open
#1,292 9 comments 1 reaction 0 assignees View on GitHub
needs: feedback-from-author type: bug
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Reproduced on this test.js:

``` javascript
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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.