Skip to content

Commit

Permalink
Merge branch 'main' into gagik/get-shard-orphan-documents
Browse files Browse the repository at this point in the history
  • Loading branch information
gagik authored Oct 9, 2024
2 parents 9edd6e7 + 664380b commit 61f57da
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/e2e-tests/test/test-shell-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ export function ensureTestShellAfterHook(
// Store the set of shells to kill afterwards
const shells = new Set<TestShell>();
suite[symbol] = shells;
suite[hookName](async () => {
suite[hookName](async function () {
const shellsToKill = [...shells];
shells.clear();

if (this.currentTest?.state === 'failed') {
for (const shell of shellsToKill) {
console.error(shell.debugInformation());
}
}

await Promise.all(
shellsToKill.map((shell) => {
// TODO: Consider if it's okay to kill those that are already killed?
shell.kill();
if (shell.process.exitCode === null) {
shell.kill();
}
return shell.waitForExit();
})
);
Expand Down

0 comments on commit 61f57da

Please sign in to comment.