Quit VM when execute test times out

A future test project will be designed such that failing to
quit the VM after timing out would severely inhibit the
performance of the other tests.
This commit is contained in:
Thomas Weber committed 2025-03-07 01:11:17 -06:00
1 parent 709d155be8
commit 2d29cdc63a
1 file changed
+3
+3
View File
@@ -45,6 +45,9 @@ const whenThreadsComplete = (t, vm, uri, timeLimit = 5000) =>
const timeoutId = setTimeout(() => {
t.fail(`Timeout waiting for threads to complete: ${uri}`);
reject(new Error('time limit reached'));
// Attempt to stop the lingering VM from interfering with other tests.
vm.quit();
}, timeLimit);
// Clear the interval to allow the process to exit