Before submitting
- I searched the open and closed issues for a related report.
- I removed credentials, tokens, private paths, and sensitive target data.
Area
Other
Observed behavior
When running Vitest tests or linters locally—especially under macOS Seatbelt sandboxing where /bin/ps or compiler caches return EPERM—the test harness and static-check orchestration exhibit two distinct failure/amplification modes (partly observed on local macOS runs with leaked setInterval test stubs, partly source-derived from Vitest and test-runner inspection; see separate surgical leak fix PR on fix/test-process-group-cleanup):
- Systemic
expect.pollretry storms on terminal inspection failures:- Inside
node_modules/vitest/dist/chunks/index.C4tKZ0yW.js,expect.pollcatches thrown errors and retries everyintervalms up to the project poll timeout (tests/support/testDeadlines.ts: 25ssource, 108sbuilt, up to 270slong-running). - Polling tests that throw or return
"unavailable"on/bin/psEPERM/ stderr — includingtests/boundary/process/darwinProcessRunTokenReader.test.ts:1577-1584(host.listProcesses()),tests/boundary/providers/GdbSessionReviewRegressions.test.ts:501,633,1022,src/apktool/ApktoolVersionProbe.lifecycle.test.ts:34-60,tests/boundary/providers/apktoolProcessFixture.test.ts:56-64, andtests/boundary/providers/apktoolDecodeDeadline.test.ts:40-52— spin at 20–40 Hz until the full deadline instead of failing fast on terminal inspection refusal. - Similarly,
src/process/DarwinHelperCache.ts:235-242clearskey = undefinedwhencomputeKeyrejects, so any tight retry loop invokingobserveProcessStartIdentityunder sandboxed/usr/bin/xcrunfailure re-spawnsxcrun/swiftcon every tick (tests/boundary/process/processCli.test.ts:200-204is addressed separately in the surgical test-cleanup PR).
- Inside
- Direct
vitest runnpm scripts bypassrun-exclusive.mjsanddetached: truechildren escape POSIX PGID signaling:package.json:165-189(test:run,test:boundary,test:mcp,test:acceptance,test:integration,test:coverage) invokevitest rundirectly withoutscripts/run-exclusive.mjs --unlocked.- Meanwhile,
scripts/run-exclusive-command.mjs:161-164signals-process.pidon interrupt/disconnect, which cannot reachdetached: trueprovider children spawned bysrc/process/ProviderProcess.ts:395if a Vitest worker is killed before testfinallyhooks execute. Note that unconditionally wrappingpackage.jsonvitestscripts inrun-exclusive.mjswould requireWindowsOwnedProcess(native/windows/build/rea-windows-x64.node) onwin32source tests unless platform-gated likescripts/run-development-tests.mjs.
- Unbounded
oxlintthread pool innpm run lint:scripts/ci/static-check-report.mjs:83-87pins--threads 1only whentypedis true (lint:typed), leaving untypedoxlint(package.jsonlint) uncapped across all host cores alongside concurrent Vitest/tsrs runs.
- Heavy inner-subprocess workloads and remaining
setIntervaltest stubs:- Tests spawning direct
xcrun swiftc(darwinProcessRunTokenReader.test.ts), cache-bypassingREA_DARWIN_MODULE_CACHE_PATHsetups, 32–36 MiBtsxheap children (tests/boundary/providers/desktopZipHeap.test.ts,desktopStateHeap.test.ts), the byte-by-bytebashtruncation loop (tests/boundary/filesystem/installScript.test.ts:288-340), and additionalsetInterval(() => {}, 1000)test suites outside thefix/test-process-group-cleanupPR (src/adb/AdbCommand*.test.ts,tests/boundary/process/providerOutcome.test.ts,tests/boundary/process/ownedCommand.test.ts,tests/boundary/providers/adb/adbCommandFinalization.test.ts,tests/boundary/providers/hopper/hopperClient.*.test.ts) can saturate CPU or leak stubs if interrupted under--unlocked.
- Tests spawning direct
Reproduction
- Run
expect.polltests that invokeobservePosixProcessorhost.listProcesses()inside a macOS Seatbelt sandbox where/bin/psreturnsEPERM(or inspectnode_modules/vitest/dist/chunks/index.C4tKZ0yW.jsshowingtry { ... } catchretry behavior). - Inspect
package.json:165-189,scripts/run-exclusive-command.mjs:161-164, andscripts/ci/static-check-report.mjs:83-87.
Note: Live unsandboxed/sandboxed timing benchmarks for all suites above were not all executed in full; processCli.test.ts, FirmwareCommand.test.ts, and PCAP/native cleanup suites were reproduced directly and targeted in a separate surgical PR.
Expected behavior
- Test polling helpers fail fast when inspection returns a terminal capability/permission error (
EPERM/"unavailable") instead of retrying for 25s–270s, without weakeningobservePosixProcess.tsorProcessOwnership.tsfail-closed production invariants. - Direct POSIX Vitest runs supervise or reap child process groups reliably without breaking Windows zero-addon source tests.
oxlinthonors bounded worker concurrency consistent withvitest.config.tsandrun-typescript.mjs.
Impact and scope
High local CPU saturation and test-hang amplification under macOS Seatbelt sandboxing or concurrent local runs; potential orphaned setInterval stub processes if Vitest workers are killed mid-test outside finally/onTestFinished cleanup. Does not weaken production ownership checks.
REA version
9a6ee71886 (origin/main)
Runtime and platform
Node v24.22.1; macOS arm64 (Seatbelt sandbox & local CLI)
Target and artifact context
Test suites and CI/lint runner scripts (tests/, scripts/, package.json)
Interface
Other
Earliest failure stage
Cleanup, cancellation, or lifecycle
Relevant output or evidence
Source locations verified directly at 9a6ee71886:
tests/boundary/process/darwinProcessRunTokenReader.test.ts:1577-1584tests/boundary/providers/GdbSessionReviewRegressions.test.ts:501,633,1022src/apktool/ApktoolVersionProbe.lifecycle.test.ts:34-60tests/boundary/providers/apktoolProcessFixture.test.ts:56-64tests/boundary/providers/apktoolDecodeDeadline.test.ts:40-52src/process/DarwinHelperCache.ts:235-242scripts/run-exclusive-command.mjs:161-164andsrc/process/ProviderProcess.ts:395scripts/ci/static-check-report.mjs:83-87andpackage.json:165-189tests/boundary/filesystem/installScript.test.ts:288-340,tests/boundary/providers/desktopZipHeap.test.ts,desktopStateHeap.test.ts
Typed outcome or recovery expected
Typed fail-fast test helper separating "still-running" from terminal inspection failure (EPERM / "unavailable").
Analysis or suspected cause
Source-derived analysis: Vitest expect.poll catches all exceptions (including assertion/inspection errors) and retries for the configured project poll timeout; observePosixProcess intentionally throws on EPERM so expect.poll spins instead of aborting early.
Additional context
Related issues/PRs (non-duplicate boundary):
- #9198 & PR #9261 (production Seatbelt
/bin/psEPERMhandling inanalyze-javascript-application) - #13280 (production 20 Hz macOS
pspolling and baseline/sweep scoping) - #10459 (pre-existing test suite failures)
- Surgical leak-cleanup PR on branch
fix/test-process-group-cleanup(reapssetIntervaltest stubs infinally/onTestFinishedand fixesprocessCli.test.ts:200fail-fast polling)
Activity
0No activity yet.