[GH-ISSUE #5568] [Bug] Kuna doctor cancellation test times out during preceding provider startup #3388

Closed
opened 2026-10-31 00:39:49 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @morluto on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5568

Before submitting

  • Searched open and closed issues and PRs, including merged #5241 and startup-cost issue #3813.
  • This report contains only synthetic fixtures and public source references.

Area

Other: test reliability

Observed behavior

The Kuna doctor cancellation test can fail before cancellation is requested. Its startup poll expects one fake Kuna invocation within Vitest's implicit one-second window, but the production doctor composition first inspects Ghidra. On macOS that can include compiling the process-ownership helper. The test then reports expected +0 to be 1 at the launch precondition, while its intended cancellation/join behavior has not run.

Reproduction

On source 57e76599c035a420181b665f4f2a3edad71628fb, pinned Node 24.18.0 on macOS arm64, run:

node ./node_modules/vitest/vitest.mjs run tests/boundary/providers/kuna/kunaDoctor.test.ts --project boundary

A clean isolated baseline run observed 8 passes and one failure in cancels and joins the composed Kuna doctor probe on caller cancellation. The host-close case passed. The same assertion failed during the root focused setup/doctor validation; a later warm baseline run passed 9/9. This is an intermittent startup precondition, not a demonstrated cancellation failure or a claimed CI reproduction.

Temporary isolated instrumentation measured the preceding Ghidra inspection at 893 ms, including 525 ms for Swift helper compilation. A controlled 1,200 ms delay immediately before Ghidra's ownership preparation deterministically made the original poll fail. Those instrumentation/delay changes were restored.

Expected behavior

Allow the composed prerequisite probes to start the fake Kuna child before testing cancellation. Keep the separate post-abort settlement deadline, exact caller/host reason, child-reap assertion, one-call count, and final cleanup intact. This does not require increasing a product timeout or suppressing an engine check.

Impact and scope

False local test failures on the observed macOS arm64 path. Frequency on CI and other hosts is unknown. No real Kuna engine or target executable was run. The preceding Ghidra prerequisite probe used REA's owned helper machinery, not the Ghidra engine.

REA version

Source 57e76599c035a420181b665f4f2a3edad71628fb; test source is unchanged in the later validated setup revision.

Runtime and platform

Node 24.18.0, macOS 26.3 arm64.

Target and artifact context

Scripted fake Kuna executable whose version response is gated by a temporary test file.

Interface

Other: Vitest boundary test.

Earliest failure stage

Unknown for product operation: the test fails during fixture startup, before it requests cancellation.

Relevant output or evidence

FAIL cancels and joins the composed Kuna doctor probe on caller cancellation
AssertionError: expected +0 to be 1
at kunaDoctor.test.ts:179

Pinned source: startup poll, ordered provider diagnostics, and Darwin helper preparation.

A candidate with an explicit startup wait passes under the same controlled delay. Removing only Kuna's cancellation-signal forwarding then still fails at the unchanged two-second post-abort settlement assertion; final cleanup releases the fake gate and joins the inspection. This negative control confirms the proposed correction retains the cancellation protection.

Typed outcome or recovery expected

No product outcome change. Keep AnalysisCancelledError, the exact opaque caller or host-close reason, and positive child-reap evidence.

Analysis or suspected cause

The startup wait currently includes unrelated first-use Ghidra prerequisite work in a one-second polling assumption. Merged #5241 addresses actual signal propagation and joining; this report concerns that regression test's startup boundary. #3813 concerns repeated CLI startup costs and a different lifecycle test.

Originally created by @morluto on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5568 ### Before submitting - [x] Searched open and closed issues and PRs, including merged #5241 and startup-cost issue #3813. - [x] This report contains only synthetic fixtures and public source references. ### Area Other: test reliability ### Observed behavior The Kuna doctor cancellation test can fail before cancellation is requested. Its startup poll expects one fake Kuna invocation within Vitest's implicit one-second window, but the production doctor composition first inspects Ghidra. On macOS that can include compiling the process-ownership helper. The test then reports `expected +0 to be 1` at the launch precondition, while its intended cancellation/join behavior has not run. ### Reproduction On source `57e76599c035a420181b665f4f2a3edad71628fb`, pinned Node 24.18.0 on macOS arm64, run: ```sh node ./node_modules/vitest/vitest.mjs run tests/boundary/providers/kuna/kunaDoctor.test.ts --project boundary ``` A clean isolated baseline run observed 8 passes and one failure in `cancels and joins the composed Kuna doctor probe on caller cancellation`. The host-close case passed. The same assertion failed during the root focused setup/doctor validation; a later warm baseline run passed 9/9. This is an intermittent startup precondition, not a demonstrated cancellation failure or a claimed CI reproduction. Temporary isolated instrumentation measured the preceding Ghidra inspection at 893 ms, including 525 ms for Swift helper compilation. A controlled 1,200 ms delay immediately before Ghidra's ownership preparation deterministically made the original poll fail. Those instrumentation/delay changes were restored. ### Expected behavior Allow the composed prerequisite probes to start the fake Kuna child before testing cancellation. Keep the separate post-abort settlement deadline, exact caller/host reason, child-reap assertion, one-call count, and final cleanup intact. This does not require increasing a product timeout or suppressing an engine check. ### Impact and scope False local test failures on the observed macOS arm64 path. Frequency on CI and other hosts is unknown. No real Kuna engine or target executable was run. The preceding Ghidra prerequisite probe used REA's owned helper machinery, not the Ghidra engine. ### REA version Source `57e76599c035a420181b665f4f2a3edad71628fb`; test source is unchanged in the later validated setup revision. ### Runtime and platform Node 24.18.0, macOS 26.3 arm64. ### Target and artifact context Scripted fake Kuna executable whose version response is gated by a temporary test file. ### Interface Other: Vitest boundary test. ### Earliest failure stage Unknown for product operation: the test fails during fixture startup, before it requests cancellation. ### Relevant output or evidence ```text FAIL cancels and joins the composed Kuna doctor probe on caller cancellation AssertionError: expected +0 to be 1 at kunaDoctor.test.ts:179 ``` Pinned source: [startup poll](https://github.com/morluto/rea/blob/57e76599c035a420181b665f4f2a3edad71628fb/tests/boundary/providers/kuna/kunaDoctor.test.ts#L179), [ordered provider diagnostics](https://github.com/morluto/rea/blob/57e76599c035a420181b665f4f2a3edad71628fb/src/doctorRuntime.ts#L52), and [Darwin helper preparation](https://github.com/morluto/rea/blob/57e76599c035a420181b665f4f2a3edad71628fb/src/process/OwnedCommand.ts#L103). A candidate with an explicit startup wait passes under the same controlled delay. Removing only Kuna's cancellation-signal forwarding then still fails at the unchanged two-second post-abort settlement assertion; final cleanup releases the fake gate and joins the inspection. This negative control confirms the proposed correction retains the cancellation protection. ### Typed outcome or recovery expected No product outcome change. Keep `AnalysisCancelledError`, the exact opaque caller or host-close reason, and positive child-reap evidence. ### Analysis or suspected cause The startup wait currently includes unrelated first-use Ghidra prerequisite work in a one-second polling assumption. Merged #5241 addresses actual signal propagation and joining; this report concerns that regression test's startup boundary. #3813 concerns repeated CLI startup costs and a different lifecycle test.
bsakaguchi 2026-10-31 00:39:49 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@matbrgz commented on GitHub (Oct 20, 2026):

Cross-referencing with canonical issue #5105 ([Bug] Setup advertises Kuna for deep analysis after its cache check fails) and siblings #4624, #5554, #5611. All address Kuna provider startup, cancellation handling, and readiness verification. Cataloged under Cluster BD in consolidation tracker #4330.

<!-- gh-comment-id:6295984795 --> @matbrgz commented on GitHub (Oct 20, 2026): Cross-referencing with canonical issue #5105 (`[Bug] Setup advertises Kuna for deep analysis after its cache check fails`) and siblings #4624, #5554, #5611. All address Kuna provider startup, cancellation handling, and readiness verification. Cataloged under Cluster BD in consolidation tracker #4330.
Author
Owner

@morluto commented on GitHub (Oct 21, 2026):

Closing as fixed on main by github.com/morluto/rea@7b2087e449, retained at 67a6477f01.

The Kuna doctor cancellation test now separately allows prerequisite ownership-helper startup, then enforces the existing two-second post-abort join bound, exact reason, child reaping, single invocation and cleanup. This is the reported test-startup correction, not a product timeout change.

This closure follows current-main producer and regression source inspection and the existing issue evidence. Tests and runtime reproductions were not rerun in this audit; no additional platform/provider coverage is implied.

<!-- gh-comment-id:6324275280 --> @morluto commented on GitHub (Oct 21, 2026): Closing as fixed on main by https://github.com/morluto/rea/commit/7b2087e44968dbc85dda1037dbec3ad1bf85e88e, retained at 67a6477f011ae358fc333e5a6e26c86d932654ed. The Kuna doctor cancellation test now separately allows prerequisite ownership-helper startup, then enforces the existing two-second post-abort join bound, exact reason, child reaping, single invocation and cleanup. This is the reported test-startup correction, not a product timeout change. This closure follows current-main producer and regression source inspection and the existing issue evidence. Tests and runtime reproductions were not rerun in this audit; no additional platform/provider coverage is implied.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3388
No description provided.