Correctly route errors that occur while a QueueRunner is clearing stack

Besides surfacing the error in the hopefully-correct place, this also
prevents the queue runners for sibling suites from interleaving, which
in turn prevents all kinds of internal state corruption.

Signed-off-by: Gregg Van Hove <gvanhove@pivotal.io>
This commit is contained in:
Steve Gravrock
2017-05-09 14:44:53 -07:00
committed by Gregg Van Hove
parent 2835ca3cce
commit b1e97cfb09
4 changed files with 75 additions and 3 deletions

View File

@@ -238,6 +238,10 @@ getJasmineRequireObj().Env = function(j$) {
reporter.suiteStarted(suite.result);
},
nodeComplete: function(suite, result) {
if (suite !== currentSuite()) {
throw new Error('Tried to complete the wrong suite');
}
if (!suite.markedPending) {
clearResourcesForRunnable(suite.id);
}