test: fix false-pass assertions, consolidate suites, and close coverage gaps (#15519)

* test: fix false-pass assertions, consolidate suites, and close coverage gaps

* test: finish signal-0, unchecked close_binary, and vacuous .every() audit

* test(registration): run shared capture inside test so child inherits scaled deadline

* test(artifacts): bind final verification fault to reader source and post-read phase
This commit is contained in:
morluto authored and GitHub committed 2026-12-01 18:10:12 +00:00
1 parent a1a0f4287c
commit a69837647b
73 files changed
+1114 -619

No files matched your search

@@ -12,6 +12,7 @@ import { spawnOwnedProviderProcess } from "../../process/ProviderProcess.js";
import { WorkerFrameSignal } from "../../process/WorkerFrameSignal.js";
import { EventEmitter } from "node:events";
import { phaseArrival } from "../../../tests/support/lifecycleHarness.js";
import { processHasStopped } from "../../../tests/support/process/observePosixProcess.js";
const text = "export const observed = 1;";
const file: JavaScriptArtifactFile = {
@@ -26,15 +27,6 @@ const file: JavaScriptArtifactFile = {
};
const budget = { nodes: 100, unknowns: 100 };
const alive = (pid: number): boolean => {
try {
process.kill(pid, 0);
return true;
} catch {
return false;
}
};
/** Launch a stand-in worker script under the real owned-process launcher. */
const standInWorker = (script: string) => {
const pids: number[] = [];
@@ -69,7 +61,9 @@ it("refuses a worker that emits facts before its ready frame and stops it", asyn
expect(worker.canReuse()).toBe(false);
// The refusal itself stops the child; close() is only teardown.
expect(fixture.pids).toHaveLength(1);
expect(fixture.pids.filter(alive)).toEqual([]);
expect(fixture.pids.length).toBeGreaterThan(0);
for (const pid of fixture.pids)
expect(await processHasStopped(pid)).toBe(true);
});
it("times out a worker whose ready frame never arrives and stops it", async () => {
@@ -101,7 +95,9 @@ it("times out a worker whose ready frame never arrives and stops it", async () =
expect(refused.error.error.cleanupIncomplete).toBe(false);
// The refusal itself stops the child; close() is only teardown.
expect(fixture.pids).toHaveLength(1);
expect(fixture.pids.filter(alive)).toEqual([]);
expect(fixture.pids.length).toBeGreaterThan(0);
for (const pid of fixture.pids)
expect(await processHasStopped(pid)).toBe(true);
});
it("wakes a silent worker on an owned memory refusal before the deadline", async () => {