From 35732c9dabfc72e7c2d857abfef95bd719adb043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kr=C3=A6n=20Hansen?= Date: Wed, 18 Sep 2024 12:17:34 +0200 Subject: [PATCH] Remove open shells as they get killed --- packages/e2e-tests/test/test-shell.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/test/test-shell.ts b/packages/e2e-tests/test/test-shell.ts index f79668cef..3cbb3ae2e 100644 --- a/packages/e2e-tests/test/test-shell.ts +++ b/packages/e2e-tests/test/test-shell.ts @@ -156,8 +156,10 @@ export class TestShell { } static async killAll(): Promise { + // Using splice to mutate the array of open shells in-place + const openShells = TestShell._openShells.splice(0); await Promise.all( - TestShell._openShells.map((shell) => { + openShells.map((shell) => { shell.kill(); return shell.waitForExit(); })