Skip to content

test(rizin): own fake provider cleanup in shared fixtures - #3735

Merged
N0zoM1z0 merged 3 commits into
morluto:mainfrom
Kenmege:fix/rizin-startup-uncertainty-reap
Oct 15, 2026
Merged

N0zoM1z0 merged 3 commits into
morluto:mainfrom
Kenmege:fix/rizin-startup-uncertainty-reap

Conversation

@Kenmege

@Kenmege Kenmege commented Oct 14, 2026 •

Copy link
Copy Markdown

Summary

The Rizin coverage harness discarded managers after deliberately uncertain cleanup while their real fake-provider children could remain alive. Linux probes on main a40ee741c reproduced the startup child surviving teardown for one second and found three further live children after per-test cleanup in the partial-timeout, truncated-output and cancellation cases. Persistence after worker exit was not measured for those three.

The shared harness now owns its native launches, reaps them with the existing bounded ProviderProcessSupervisor, and requires observed child exit. All four coverage files use its manager factory; custom injected spawners remain selected by the caller. Unsuccessful cleanup retains the owned process and every fixture directory for recovery. The original uncertainty, partial Evidence and inherited-output assertions remain intact. No product behavior, provider policy or public contract changes.

Validation performed

Integrated latest main 9d6651e5b; head 5d85cfe4e. Five fixture/test files changed. Linux x64, Node 24.18.0/npm 11.16.0, two CPU cores, serial heavy workflows, 1.5 GiB Node heap.

  • Seven focused files: 87 passed, 1 Darwin-only case skipped. Includes all four Rizin coverage files and native supervisor TERM/KILL escalation, bounded waits, incomplete cleanup/retry and output tests.
  • Independent post-cleanup observation of part4: all eight real fake-provider children had exited; the observer's safety reaper sent no termination. The old harness failed three corresponding postconditions. All probe processes were reaped through their retained owned handles.
  • Controlled removal of reaping and replacement of waiting with signal-only cleanup: two expected failures each. Restored source passes. Regression failure paths also reap their observed child.
  • Cleanup failure/recovery retains a live child and its files, admits another fixture, then verifies actual exit and removal of both directories after recovery.
  • npm ci, build:cached, all eight check:ci tasks and architecture guards passed. Normal pre-push check:fast passed. Current-head Greptile (5/5) and Codex reviews completed without findings.

Completed focused workflow on the integrated head (including an artifact rebuild): wall 31.88s, child user/system CPU 43.58/6.28s, sampled peak family RSS 3.09 GiB. Earlier warm-artifact execution of the same seven test files: 7.17s, 5.07/2.48s, 705 MiB. Fresh Vitest/provider processes; tool and file caches warm. RSS sums live descendants with a 100ms pause; shared pages can repeat and short/reparented children can be missed. Wait-accounted CPU excludes the measurement wrapper. The failed baseline has no equivalent completed cleanup result; no speedup or lower peak-memory claim is made. Agent tokens are unmeasured; no agent-facing response changes.

Native macOS arm64 / Node 24.18.0: 88 passed, zero skips across all seven files, including the Darwin-only ownership/cancellation case. Hosted proof uses diagnostic commit 2583c25d2, whose only difference from PR head 5d85cfe4e is the manual CI workflow. Its gate verifies that source identity, actual Darwin host, fresh JSON report and exact counts; the uploaded report was downloaded and independently checked. Hosted CPU and peak memory were not measured.

This verifies real fixture processes, not a real Rizin debugger.

Ownership and readiness

Original contributor: @Kenmege. The user explicitly delegated the follow-up implementation, technical review, ready-for-review update and merge in this session. Technical review was performed by the assistant; a separate human reread is not claimed.

  • Final diff, ownership boundaries, validation evidence and limitations technically reviewed.
  • Ready for initial maintainer review under the user's explicit authorization.

Before merge

  • Concrete fixture problem and existing process authority established.
  • Current-head reviews and native macOS evidence recorded.
  • Complete current-head CI passed, including all five shards, Portable tests and the required selection gate. Optional lanes were skipped according to scope. Greptile and Codex reviewed 5d85cfe4e without findings.

"preserves startup cleanup uncertainty after cancellation" starts a fake Rizin
that never answers the detach request. The real stop therefore reports
"inferior detach was not verified" and correctly retains ownership, and the
injected incompleteStop teardown cannot stop it either, so every run left an
orphaned fake-rizin.mjs process group behind (reproduced on macOS 27.0.1).

Reap the owned launch in a finally block with cleanupOwnedProcessGroup and a
SIGKILL fallback, then await its exit, matching the GDB review regression.
Also drop the unused RizinDebugSessionManager import flagged by oxlint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kaoru0822-kitauji
kaoru0822-kitauji marked this pull request as ready for review October 15, 2026 06:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T15:18:43.664693Z 5d85cfe Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The reviewed changes appear safe to merge; no blocking defects were found.

Summary

The shared Rizin test harness now owns its fake-provider children separately from the manager and waits for their exit before removing fixture files.

  • Rizin coverage cleanup waits for fake providers to exit before deleting fixtures.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Shared manager factory] --> B[Launch fake provider]
  B --> C[Retain owned child handle]
  D[Fixture cleanup] --> E[Close managers]
  E --> F[Stop owned children]
  F --> G{Child exit observed?}
  G -->|No| H[Keep handles and files for retry]
  G -->|Yes, for every child| I[Remove fixture directories]
Loading

Reviews (2) · Last reviewed commit: "chore(ci): refresh Rizin fixture audit a..." · Reviewed by Greptile

N0zoM1z0 and others added 2 commits October 15, 2026 14:54
Preserve injected cleanup uncertainty and partial evidence while the fixture harness reaps and awaits its actual spawned children. Retain failed resources and every owned directory for retry; cover missing reaping, missing exit waits, and cleanup recovery.

Co-authored-by: Kaoru0822 <[email protected]>
Integrate main 9d6651e before publishing the shared fixture lifetime fix. The incoming Apple, Kuna and WABT changes do not alter the Rizin or process supervision boundaries.

Co-authored-by: Kaoru0822 <[email protected]>
@N0zoM1z0 N0zoM1z0 changed the title fix(test): reap the Rizin provider left by startup cleanup uncertainty test(rizin): own fake provider cleanup in shared fixtures Oct 15, 2026
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 5d85cfe4eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification provider: rizin Analysis provider / engine: rizin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants