From d87e2c2714293975455027ca46f8d65fe24330bb Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sun, 15 Nov 2026 17:21:41 +0800 Subject: [PATCH] test(kuna): assert probe and scan outcomes instead of elapsed-time bounds (#10954) test(kuna): assert the probe and scan outcomes instead of elapsed-time bounds --- tests/boundary/providers/kuna/kunaInstallation.test.ts | 6 +++--- tests/boundary/providers/kuna/kunaStrings.test.ts | 4 ++-- .../providers/kuna/kunaVersionProbeOwnership.test.ts | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/boundary/providers/kuna/kunaInstallation.test.ts b/tests/boundary/providers/kuna/kunaInstallation.test.ts index cbbabed282..1f2d0fb36a 100644 --- a/tests/boundary/providers/kuna/kunaInstallation.test.ts +++ b/tests/boundary/providers/kuna/kunaInstallation.test.ts @@ -295,7 +295,6 @@ it("parses cache, timeout and job settings at the configuration boundary", () => it("stops a version probe that ignores SIGTERM instead of waiting on it", async () => { const root = await createTestTempDirectory("rea-kuna-probe-term-"); const kuna = await writeFakeKuna(root, { version: { ignoreTerm: true } }); - const started = Date.now(); const result = await inspectKunaInstallation( { REA_KUNA_COMMAND: kuna }, @@ -310,11 +309,12 @@ it("stops a version probe that ignores SIGTERM instead of waiting on it", async diagnostics: { probe_failure_reason: "timeout", deadline_ms: 4_000, + signal: "SIGKILL", }, }, }); - // The owned process-group stop is bounded and must not wait on inherited output forever. - expect(Date.now() - started).toBeLessThan(10_000); + // The stop escalated past the ignored SIGTERM; waiting on the probe instead + // would hang until the test deadline names it. const pid = (await fakeKunaCalls(kuna))[0]?.pid ?? 0; expect(() => process.kill(pid, 0)).toThrow(); }); diff --git a/tests/boundary/providers/kuna/kunaStrings.test.ts b/tests/boundary/providers/kuna/kunaStrings.test.ts index 2651838388..89de5eb104 100644 --- a/tests/boundary/providers/kuna/kunaStrings.test.ts +++ b/tests/boundary/providers/kuna/kunaStrings.test.ts @@ -209,7 +209,8 @@ it("stops Kuna at the first contradictory row instead of awaiting the rest", asy ); const client = open(); try { - const started = Date.now(); + // Awaiting the hung scan would end at the 60 s project deadline with a + // deadline error; only a stop at the rejected row reports the output. expect( await client.execute("search_strings", { pattern: "fixture" }), ).toMatchObject({ @@ -220,7 +221,6 @@ it("stops Kuna at the first contradictory row instead of awaiting the rest", asy diagnostics: { producer_operation: "kuna:strings" }, }, }); - expect(Date.now() - started).toBeLessThan(30_000); await setFakeKunaBehavior(kuna, {}); expect((await run(client, "list_strings")).result).toHaveLength(2); expect(await scans(kuna)).toHaveLength(2); diff --git a/tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts b/tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts index ac517be3f7..eae94f0db0 100644 --- a/tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts +++ b/tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts @@ -103,7 +103,6 @@ it.skipIf(process.platform === "win32")( ); const launcher = makeLauncher(); const scope = new ArtifactResourceScope(); - const startedAt = Date.now(); try { const result = await inspectKunaInstallation( { REA_KUNA_COMMAND: executable }, @@ -136,7 +135,6 @@ it.skipIf(process.platform === "win32")( }); await waitForFile(childStarted); await waitForFile(parentExited); - expect(Date.now() - startedAt).toBeLessThan(7_000); expect(scope.hasPending).toBe(false); expect(launcher.groups).toHaveLength(1); } finally {