Skip to content

Commit d350738

Browse files
committed
fix(test): skip Windows SIGINT restoration check
Windows process.kill(..., "SIGINT") terminates the target process instead of delivering a recoverable signal event. Skip the portability check there so CI only asserts behavior the platform can actually support.
1 parent c74002d commit d350738

1 file changed

Lines changed: 17 additions & 12 deletions

File tree

packages/fuzzer/libafl_runtime.test.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,13 @@ describe("LibAFL runtime", () => {
219219
}
220220
});
221221

222-
it("restores previous SIGINT handlers after fuzzing", () => {
223-
const options = { ...libAflOptions, runs: 1 };
224-
const script = `
222+
// On Windows, process.kill(..., "SIGINT") terminates the target process
223+
// instead of delivering a recoverable signal event to userland listeners.
224+
(process.platform === "win32" ? it.skip : it)(
225+
"restores previous SIGINT handlers after fuzzing",
226+
() => {
227+
const options = { ...libAflOptions, runs: 1 };
228+
const script = `
225229
const addon = require(${JSON.stringify(nativeAddonPath())});
226230
addon.registerCoverageMap(Buffer.alloc(${1 << 20}));
227231
addon.registerNewCounters(0, 512);
@@ -242,16 +246,17 @@ describe("LibAFL runtime", () => {
242246
});
243247
`;
244248

245-
const result = spawnSync(process.execPath, ["-e", script], {
246-
encoding: "utf8",
247-
});
249+
const result = spawnSync(process.execPath, ["-e", script], {
250+
encoding: "utf8",
251+
});
248252

249-
if (result.signal !== null || result.status !== 0) {
250-
throw new Error(
251-
`Child process exited with status ${result.status} and signal ${result.signal}: ${result.stderr}`,
252-
);
253-
}
254-
});
253+
if (result.signal !== null || result.status !== 0) {
254+
throw new Error(
255+
`Child process exited with status ${result.status} and signal ${result.signal}: ${result.stderr}`,
256+
);
257+
}
258+
},
259+
);
255260

256261
it("records compare feedback in the shared native map", async () => {
257262
addon.clearCompareFeedbackMap();

0 commit comments

Comments
 (0)