[PR #609] [MERGED] fix(test): improve capture reliability and runner cleanup #2109

Closed
opened 2026-10-16 21:14:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/609
Author: @morluto
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @morluto

Base: main ← Head: fix/test-readiness-and-lifecycle


📝 Commits (3)

  • c50371d test: make capture fixtures readiness-aware and strengthen assertions
  • c264bca fix(test): escalate child termination and report cleanup failures
  • 20244a7 perf(test): use runner concurrency and lock shared build outputs

📊 Changes

14 files changed (+318 additions, -107 deletions)

View changed files

📝 docs/testing.md (+7 -3)
📝 package.json (+8 -7)
📝 scripts/lib/development-tests.mjs (+0 -1)
📝 scripts/run-development-tests.mjs (+20 -15)
📝 scripts/run-exclusive.mjs (+10 -2)
📝 tests/acceptance/applications/applicationEvidenceMcp.test.ts (+29 -0)
📝 tests/boundary/browser/webSourceMapFetcher.test.ts (+2 -2)
📝 tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts (+10 -2)
📝 tests/boundary/process/processCaptureLifecycle.test.ts (+55 -16)
📝 tests/fixtures/processFidelity.mjs (+34 -18)
➕ tests/process-global/runnerCancellation.test.ts (+64 -0)
📝 tests/process-global/verifierRun.test.ts (+49 -4)
📝 tests/support/process/processFixture.ts (+25 -6)
📝 vitest.config.ts (+5 -31)

📄 Description

PTY tests assumed children were ready at fixed offsets, some MCP assertions accepted any successful payload, and cancellation could wait indefinitely for a child that ignored termination. This change makes the fixtures tolerate startup timing, checks meaningful result identities and evidence, and adds termination escalation with explicit cleanup failures.

The process-tree fixture now signals when its descendants are ready, provides a two-second sampling window, and exits normally so capture verifies descendant cleanup. Signal dispatch is tested separately from application handler readiness. A source-map recovery regression now preserves valid imports while excluding a dynamically shadowable require inside with.

Tests use Vitest's existing worker budget rather than a broad command lock or serializing every project. The process-observation lane remains serial. Checkout-local locks protect shared build and documentation outputs; dist cleanup and compilation run under the same build lock. Runner escalation covers direct children, not arbitrary descendant trees.

Profiling on macOS showed the process-tree case falling from 10.7 seconds waiting for its deadline to 3.0 seconds in the final gate. Installer runs took 11–13 seconds, while fixture setup took only 1.5–3.2 ms per case; their coverage was retained. These measurements do not establish a general full-suite speedup.

Validation:

  • npm run check:pr: 369 files passed, 2,142 tests passed, two skipped; static and generated-document checks passed.
  • npm run build:cached and npm run docs:check: passed after the final build-lock wiring.
  • Focused capture, cancellation, MCP payload, and source-map recovery regressions passed.
  • Real Hopper/Ghidra verification and Windows execution were not performed; this changes test infrastructure and assertions, not provider analysis implementations.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/609 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/test-readiness-and-lifecycle` --- ### 📝 Commits (3) - [`c50371d`](https://github.com/morluto/rea/commit/c50371da02b588b3e6549564e0e1b72756bc9dd3) test: make capture fixtures readiness-aware and strengthen assertions - [`c264bca`](https://github.com/morluto/rea/commit/c264bca4355df48bea28252c29e98e38d665c911) fix(test): escalate child termination and report cleanup failures - [`20244a7`](https://github.com/morluto/rea/commit/20244a765c32d336749a3fc0b5aafbe8dfac6b20) perf(test): use runner concurrency and lock shared build outputs ### 📊 Changes **14 files changed** (+318 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `docs/testing.md` (+7 -3) 📝 `package.json` (+8 -7) 📝 `scripts/lib/development-tests.mjs` (+0 -1) 📝 `scripts/run-development-tests.mjs` (+20 -15) 📝 `scripts/run-exclusive.mjs` (+10 -2) 📝 `tests/acceptance/applications/applicationEvidenceMcp.test.ts` (+29 -0) 📝 `tests/boundary/browser/webSourceMapFetcher.test.ts` (+2 -2) 📝 `tests/boundary/mcp/enhancedTools.01-lists-the-complete-target-open.test.ts` (+10 -2) 📝 `tests/boundary/process/processCaptureLifecycle.test.ts` (+55 -16) 📝 `tests/fixtures/processFidelity.mjs` (+34 -18) ➕ `tests/process-global/runnerCancellation.test.ts` (+64 -0) 📝 `tests/process-global/verifierRun.test.ts` (+49 -4) 📝 `tests/support/process/processFixture.ts` (+25 -6) 📝 `vitest.config.ts` (+5 -31) </details> ### 📄 Description PTY tests assumed children were ready at fixed offsets, some MCP assertions accepted any successful payload, and cancellation could wait indefinitely for a child that ignored termination. This change makes the fixtures tolerate startup timing, checks meaningful result identities and evidence, and adds termination escalation with explicit cleanup failures. The process-tree fixture now signals when its descendants are ready, provides a two-second sampling window, and exits normally so capture verifies descendant cleanup. Signal dispatch is tested separately from application handler readiness. A source-map recovery regression now preserves valid imports while excluding a dynamically shadowable `require` inside `with`. Tests use Vitest's existing worker budget rather than a broad command lock or serializing every project. The process-observation lane remains serial. Checkout-local locks protect shared build and documentation outputs; dist cleanup and compilation run under the same build lock. Runner escalation covers direct children, not arbitrary descendant trees. Profiling on macOS showed the process-tree case falling from 10.7 seconds waiting for its deadline to 3.0 seconds in the final gate. Installer runs took 11–13 seconds, while fixture setup took only 1.5–3.2 ms per case; their coverage was retained. These measurements do not establish a general full-suite speedup. Validation: - `npm run check:pr`: 369 files passed, 2,142 tests passed, two skipped; static and generated-document checks passed. - `npm run build:cached` and `npm run docs:check`: passed after the final build-lock wiring. - Focused capture, cancellation, MCP payload, and source-map recovery regressions passed. - Real Hopper/Ghidra verification and Windows execution were not performed; this changes test infrastructure and assertions, not provider analysis implementations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:22 +00:00
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#2109
No description provided.