update runtime thread tests

Threads are now removed after every "inner" step. Any thread that
reaches its DONE conditions is immediately removed instead of requiring
an extra step to remove it. As such tests that check the number of
threads have been updated to consider this.
This commit is contained in:
Michael "Z" Goddard committed 2018-10-31 17:56:12 -04:00
1 parent b833ef8d24
commit 2ffa8eb333
5 files changed
+73 -34

No files matched your search

+10
View File
@@ -188,6 +188,13 @@ class Runtime extends EventEmitter {
*/
this._nonMonitorThreadCount = 0;
/**
* All threads that finished running and were removed from this.threads
* by behaviour in Sequencer.stepThreads.
* @type {Array<Thread>}
*/
this._lastStepDoneThreads = null;
/**
* Currently known number of clones, used to enforce clone limit.
* @type {number}
@@ -1560,6 +1567,9 @@ class Runtime extends EventEmitter {
this._emitProjectRunStatus(
this.threads.length + doneThreads.length -
this._getMonitorThreadCount([...this.threads, ...doneThreads]));
// Store threads that completed this iteration for testing and other
// internal purposes.
this._lastStepDoneThreads = doneThreads;
if (this.renderer) {
// @todo: Only render when this.redrawRequested or clones rendered.
if (this.profiler !== null) {