From cce92b9fa2e3f72c842aabce2b39e87961ac4868 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 16 Oct 2024 13:31:31 -0700 Subject: [PATCH 1/5] Don't warn on ignored signals on windows --- ext/node/polyfills/process.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 3dc6ce61aabd7c..32255799cc4fb8 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -522,7 +522,6 @@ Process.prototype.on = function ( ) { // Ignores all signals except SIGBREAK and SIGINT on windows. // deno-lint-ignore no-console - console.warn(`Ignoring signal "${event}" on Windows`); } else { EventEmitter.prototype.on.call(this, event, listener); Deno.addSignalListener(event as Deno.Signal, listener); From a09db75b717568b185bc08dc67364591f6867fd1 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 16 Oct 2024 13:43:08 -0700 Subject: [PATCH 2/5] . --- ext/node/polyfills/process.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 32255799cc4fb8..6cae95d071f3b1 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -520,8 +520,7 @@ Process.prototype.on = function ( } else if ( event !== "SIGBREAK" && event !== "SIGINT" && Deno.build.os === "windows" ) { - // Ignores all signals except SIGBREAK and SIGINT on windows. - // deno-lint-ignore no-console + // TODO: Ignores all signals except SIGBREAK and SIGINT on windows. } else { EventEmitter.prototype.on.call(this, event, listener); Deno.addSignalListener(event as Deno.Signal, listener); From d8e54bfc622be1094c3f01d03f2d6d8a06449f68 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 16 Oct 2024 13:52:16 -0700 Subject: [PATCH 3/5] Appease lint --- ext/node/polyfills/process.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index 6cae95d071f3b1..2605fa6d1ad743 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -520,7 +520,7 @@ Process.prototype.on = function ( } else if ( event !== "SIGBREAK" && event !== "SIGINT" && Deno.build.os === "windows" ) { - // TODO: Ignores all signals except SIGBREAK and SIGINT on windows. + // TODO(#26331): Ignores all signals except SIGBREAK and SIGINT on windows. } else { EventEmitter.prototype.on.call(this, event, listener); Deno.addSignalListener(event as Deno.Signal, listener); From ac640a2a0d3c56fdad9564d606c5f81649cac832 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 16 Oct 2024 15:19:07 -0700 Subject: [PATCH 4/5] Rm unneeded test --- tests/unit_node/process_test.ts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 9506fb6091eced..1754ec149d125b 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -239,33 +239,6 @@ Deno.test({ }, }); -Deno.test({ - name: "process.on - ignored signals on windows", - ignore: Deno.build.os !== "windows", - fn() { - const ignoredSignals = ["SIGHUP", "SIGUSR1", "SIGUSR2"]; - - for (const signal of ignoredSignals) { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on(signal, handler); - process.off(signal, handler); - assertSpyCall(consoleSpy, 0, { - args: [`Ignoring signal "${signal}" on Windows`], - }); - } - - { - using consoleSpy = spy(console, "warn"); - const handler = () => {}; - process.on("SIGTERM", handler); - process.off("SIGTERM", handler); - // No warning is made for SIGTERM - assertSpyCalls(consoleSpy, 0); - } - }, -}); - Deno.test( { permissions: { run: true, read: true } }, async function processKill() { From 6b14871c95c643b1bf620b72b60d86ab0f560ae5 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Wed, 16 Oct 2024 17:03:28 -0700 Subject: [PATCH 5/5] Appease linter --- tests/unit_node/process_test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index 1754ec149d125b..f9138c8f08fcff 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -25,7 +25,6 @@ import { assertThrows, fail, } from "@std/assert"; -import { assertSpyCall, assertSpyCalls, spy } from "@std/testing/mock"; import { stripAnsiCode } from "@std/fmt/colors"; import * as path from "@std/path"; import { delay } from "@std/async/delay";