Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphify-out/graph.json

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions lib/hosts/update-worker.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ before(async () => {
delete process.env.OMP_WEB_DISABLE_AUTOUPDATE;
worker = await import("./update-worker.ts");
});
after(() => {
after(async () => {
for (const child of children) { try { child.kill(); } catch {} }
for (const file of healthFiles) { try { process.kill(JSON.parse(readFileSync(file)).pid, "SIGTERM"); } catch {} }
const relaunched = healthFiles.flatMap((file) => { try { return [JSON.parse(readFileSync(file)).pid]; } catch { return []; } });
for (const pid of relaunched) { try { process.kill(pid, "SIGTERM"); } catch {} }
// A relaunched host runs with its cwd inside `base`; Windows keeps that directory locked (EBUSY) until the
// process has exited, and a kill returns before it has.
const pids = [...children.map((child) => child.pid), ...relaunched];
for (let i = 0; i < 100 && pids.some(alive); i++) await wait(50);
process.env = saved;
// The children were only signalled: on Windows one still holds a handle in `base` for a moment (EBUSY).
// A handle a process releases just after its exit (antivirus, the search indexer) still gets retried.
rmSync(base, { recursive: true, force: true, maxRetries: 20, retryDelay: 100 });
});

Expand Down
Loading