Skip to content

Commit 167f674

Browse files
authored
fix: don't warn on ignored signals on windows (denoland#26332)
Closes denoland#26183. The warnings are super noisy and not actionable for the user
1 parent 458d627 commit 167f674

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

ext/node/polyfills/process.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,7 @@ Process.prototype.on = function (
520520
} else if (
521521
event !== "SIGBREAK" && event !== "SIGINT" && Deno.build.os === "windows"
522522
) {
523-
// Ignores all signals except SIGBREAK and SIGINT on windows.
524-
// deno-lint-ignore no-console
525-
console.warn(`Ignoring signal "${event}" on Windows`);
523+
// TODO(#26331): Ignores all signals except SIGBREAK and SIGINT on windows.
526524
} else {
527525
EventEmitter.prototype.on.call(this, event, listener);
528526
Deno.addSignalListener(event as Deno.Signal, listener);

tests/unit_node/process_test.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
assertThrows,
2626
fail,
2727
} from "@std/assert";
28-
import { assertSpyCall, assertSpyCalls, spy } from "@std/testing/mock";
2928
import { stripAnsiCode } from "@std/fmt/colors";
3029
import * as path from "@std/path";
3130
import { delay } from "@std/async/delay";
@@ -239,33 +238,6 @@ Deno.test({
239238
},
240239
});
241240

242-
Deno.test({
243-
name: "process.on - ignored signals on windows",
244-
ignore: Deno.build.os !== "windows",
245-
fn() {
246-
const ignoredSignals = ["SIGHUP", "SIGUSR1", "SIGUSR2"];
247-
248-
for (const signal of ignoredSignals) {
249-
using consoleSpy = spy(console, "warn");
250-
const handler = () => {};
251-
process.on(signal, handler);
252-
process.off(signal, handler);
253-
assertSpyCall(consoleSpy, 0, {
254-
args: [`Ignoring signal "${signal}" on Windows`],
255-
});
256-
}
257-
258-
{
259-
using consoleSpy = spy(console, "warn");
260-
const handler = () => {};
261-
process.on("SIGTERM", handler);
262-
process.off("SIGTERM", handler);
263-
// No warning is made for SIGTERM
264-
assertSpyCalls(consoleSpy, 0);
265-
}
266-
},
267-
});
268-
269241
Deno.test(
270242
{ permissions: { run: true, read: true } },
271243
async function processKill() {

0 commit comments

Comments
 (0)