mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-07-27 14:41:45 -04:00
Fix a thread status check in integration tests to allow "done" threads
This commit is contained in:
parent
6119fba08e
commit
5579f121a9
1 changed files with 5 additions and 2 deletions
|
@ -35,9 +35,12 @@ const testFile = file => test(file, async t => {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
// waiting for all threads to complete, then we return
|
// waiting for all threads to complete, then we return
|
||||||
while (vm.runtime.threads.length > 0) {
|
|
||||||
|
while (vm.runtime.threads.filter(thread => vm.runtime.isActiveThread(thread)).length > 0) {
|
||||||
if ((Date.now() - startTime) >= TIMEOUT) {
|
if ((Date.now() - startTime) >= TIMEOUT) {
|
||||||
messages.push(`fail Threads still running after ${TIMEOUT}ms`);
|
// if we push the message after end, the failure from tap is not very useful:
|
||||||
|
// "not ok test after end() was called"
|
||||||
|
messages.unshift(`fail Threads still running after ${TIMEOUT}ms`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue