From fac7068c1efd53438576c07a539443fee818fd30 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 5 Mar 2024 21:21:28 -0700 Subject: [PATCH] chore(ext/node): ignore non-working process test (#22723) Filed https://github.com/denoland/deno/issues/22724 for actual issue --- tests/unit_node/process_test.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 7679f3681b..da3ca7a299 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -185,7 +185,11 @@ Deno.test({ name: "process.on signal", ignore: Deno.build.os == "windows", async fn() { - const testTimeout = setTimeout(() => fail("Test timed out"), 10_000); + let wait = ""; + const testTimeout = setTimeout( + () => fail("Test timed out waiting for " + wait), + 10_000, + ); try { const process = new Deno.Command(Deno.execPath(), { args: [ @@ -206,16 +210,19 @@ Deno.test({ process.stdout.pipeThrough(new TextDecoderStream()).pipeTo( new WritableStream({ write(chunk) { + console.log("chunk:", chunk); output += chunk; }, }), ); + wait = "ready"; while (!output.includes("ready\n")) { await delay(10); } - output = ""; - for (const _ of Array(3)) { + for (const i of Array(3)) { + output = ""; process.kill("SIGINT"); + wait = "foo " + i; while (!output.includes("foo\n")) { await delay(10); } @@ -230,7 +237,7 @@ Deno.test({ Deno.test({ name: "process.off signal", - ignore: Deno.build.os == "windows", + ignore: true, // This test fails to terminate async fn() { const testTimeout = setTimeout(() => fail("Test timed out"), 10_000); try { @@ -243,7 +250,7 @@ Deno.test({ setInterval(() => {}, 1000); const listener = () => { console.log("foo"); - process.off("SIGINT") + process.off("SIGINT", listener) }; process.on("SIGINT", listener); `, @@ -255,6 +262,7 @@ Deno.test({ process.stdout.pipeThrough(new TextDecoderStream()).pipeTo( new WritableStream({ write(chunk) { + console.log("chunk:", chunk); output += chunk; }, }),