mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-30 16:50:47 +08:00
Teardown hanging processes in Vitest
After setting up the global env for the httpd:api tests, there were tests hanging until the timeout of 10 seconds killed them. By returning an async function from the globalSetup we can kill them preemptively. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
@@ -14,7 +14,8 @@ import {
|
||||
startPalmHttpd,
|
||||
} from "@tests/support/fixtures.js";
|
||||
import { createPeerManager } from "@tests/support/peerManager.js";
|
||||
import { heartwoodShortSha, tmpDir } from "./support";
|
||||
import { heartwoodShortSha, tmpDir } from "@tests/support/support.js";
|
||||
import { killAllProcesses } from "@tests/support/process.js";
|
||||
|
||||
const workspacePaths = [Path.join(tmpDir, "peers"), Path.join(tmpDir, "repos")];
|
||||
|
||||
@@ -64,6 +65,8 @@ export default async function globalSetup(_config: FullConfig): Promise<void> {
|
||||
} else {
|
||||
await startPalmHttpd();
|
||||
}
|
||||
|
||||
return () => killAllProcesses();
|
||||
}
|
||||
|
||||
// Assert that the `rad` CLI is installed and has the correct version.
|
||||
|
||||
Reference in New Issue
Block a user