diff --git a/httpd-client/tests/support/fixtures.ts b/httpd-client/tests/support/fixtures.ts index dd068b3ba..6c4ed7b57 100644 --- a/httpd-client/tests/support/fixtures.ts +++ b/httpd-client/tests/support/fixtures.ts @@ -27,6 +27,6 @@ export const testFixture = test.extend({ await peer.startHttpd(); const api = new HttpdClient(peer.httpdBaseUrl); await use({ api, peer }); - await peer.stopHttpd(); + await peer.shutdown(); }, }); diff --git a/tests/e2e/node.spec.ts b/tests/e2e/node.spec.ts index 40aca97bc..5a08d1803 100644 --- a/tests/e2e/node.spec.ts +++ b/tests/e2e/node.spec.ts @@ -20,8 +20,6 @@ test("node metadata", async ({ page, peerManager }) => { page.getByText(`${shortNodeRemote}@seed.radicle.test:8123`), ).toBeVisible(); await expect(page.getByText("1.0.0-rc.8-")).toBeVisible(); - await peer.stopHttpd(); - await peer.stopNode(); }); test("node projects", async ({ page }) => { diff --git a/tests/support/peerManager.ts b/tests/support/peerManager.ts index f27bb9631..4647b3645 100644 --- a/tests/support/peerManager.ts +++ b/tests/support/peerManager.ts @@ -172,7 +172,6 @@ export class RadiclePeer { #listenSocketAddr?: string; #httpdBaseUrl?: BaseUrl; #nodeProcess?: ExecaChildProcess; - #httpdProcess?: ExecaChildProcess; // Name for easy identification. Used on file system and in logs. #name: string; #childProcesses: ExecaChildProcess[] = []; @@ -266,7 +265,7 @@ export class RadiclePeer { port, scheme: "http", }; - this.#httpdProcess = this.spawn("radicle-httpd", [ + void this.spawn("radicle-httpd", [ "--listen", `${this.#httpdBaseUrl.hostname}:${this.#httpdBaseUrl.port}`, ]); @@ -279,23 +278,6 @@ export class RadiclePeer { }); } - public async stopHttpd() { - if (!this.#httpdBaseUrl || !this.#httpdProcess) { - return; - } - this.#httpdProcess.kill("SIGTERM"); - - await waitOn({ - resources: [ - `tcp:${this.#httpdBaseUrl.hostname}:${this.#httpdBaseUrl.port}`, - ], - reverse: true, - timeout: 2000, - }); - - this.#httpdBaseUrl = undefined; - } - public async startNode(nodeParams: Partial = {}) { const listenPort = await getPort(); this.#listenSocketAddr = `0.0.0.0:${listenPort}`; @@ -355,14 +337,13 @@ export class RadiclePeer { } /** - * Kill all child processes created with `spawn()`, the node process and the - * HTTP API process. + * Kill all child processes created with `spawn()`, including the node and + * httpd processes. */ public async shutdown() { // We don’t care about proper cleanup. We just want to make sure that no // processes are running anymore. this.#childProcesses.forEach(p => p.kill("SIGKILL")); - await Promise.all([this.stopNode(), this.stopHttpd()]); } public get address(): string {