Skip to content

Commit 3f0c989

Browse files
committed
Call cleanup functions in sequence and reverse order
1 parent 1456730 commit 3f0c989

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/compass-e2e-tests/smoke-test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ async function run() {
189189
throw new Error(`Testing '${kind}' packages is not yet implemented`);
190190
}
191191
} finally {
192-
await Promise.all(cleanups.map((cleanup) => cleanup()));
192+
// Chain the cleanup functions in reverse order
193+
await cleanups
194+
.slice()
195+
.reverse()
196+
.reduce((previous, cleanup) => previous.then(cleanup), Promise.resolve());
193197
}
194198
}
195199

0 commit comments

Comments
 (0)