From a65fa2b744003d520ca502c3035df1a230b5b4a3 Mon Sep 17 00:00:00 2001 From: tolauwae Date: Thu, 1 Aug 2024 15:27:58 +0200 Subject: [PATCH] Fix shutdown in non-parallel runs --- src/framework/Framework.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/framework/Framework.ts b/src/framework/Framework.ts index d312e92..d9e9012 100644 --- a/src/framework/Framework.ts +++ b/src/framework/Framework.ts @@ -104,6 +104,10 @@ export class Framework { } const t1 = performance.now(); this.reporter.results(t1 - t0); + + await Promise.all(suites.map(suite => suite.testees.map(async (testee: Testee) => { + await timeout('Shutdown testbed', testee.timeout, testee.shutdown()); + }))) } public async run(suites: Suite[]) { @@ -124,6 +128,10 @@ export class Framework { })) const t1 = performance.now(); this.reporter.results(t1 - t0); + + await Promise.all(suites.map(suite => suite.testees.map(async (testee: Testee) => { + await timeout('Shutdown testbed', testee.timeout, testee.shutdown()); + }))) } public async parallel(suites: Suite[]) {