Repository navigation
improve(tests): speed up snapshot ownership checks - #155973
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 22, 2026, 5:54 PM ET / 21:54 UTC. ClawSweeper reviewWhat this changesReuse prepared JavaScript in SQLite snapshot ownership tests to reduce subprocess startup cost while preserving standalone TypeScript execution. Merge readiness✅ Ready for maintainer review The optimization remains useful: current main still loads TypeScript in these subprocesses. No actionable correctness or security defect was found, and the maintainer-authored PR is protected from automatic closure. Priority: P3 Review scores
Verification
How this fits togetherSQLite snapshot ownership tests check that cleanup preserves files still held by readers or child processes. The test runner prepares shared JavaScript artifacts, which fresh subprocesses load to exercise the existing ownership and reclamation behavior. flowchart TD
A[Ownership tests] --> B{Managed finite run?}
B -->|Yes| C[Invocation compiler]
C --> D[Prepared JavaScript imports]
B -->|No| E[TypeScript imports]
D --> F[Fresh child processes]
E --> F
F --> G[Ownership and cleanup assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +26, Other +4. Total +30 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one invocation-owned compiler for finite test runs while retaining source execution for standalone and watch runs. Do we have a high-confidence way to reproduce the issue? Not applicable as a product bug: this is a test-performance optimization supported by a reported paired benchmark, not a locally reproduced failure. Is this the best way to solve the issue? Yes. Registering these imports with the existing compiler removes repeated source-loading work without introducing another build owner or weakening the test scenarios. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a10c28dca079. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit '7d7f977ccfc1ac177526232e4f4960febd010015': (91 commits) test: avoid unused target setup in package profile fixtures (#155972) fix(worktrees): batch snapshot metadata reads test(plugin-state): distinguish borrowed and foreign lifecycle owners refactor(agents): share external harness session and attempt machinery (#152181) chore(i18n): refresh native locales (#156006) chore(test): retain Doctor fixture settlement diagnostics (#155944) perf(codex): reuse unchanged inference request bytes (#155987) perf(test): prepare snapshot ownership subprocess imports (#155973) perf(test): consolidate channel registry coverage (#155014) fix(runtime): preserve Node worker dependencies and cleanup diagnostics (#155292) perf(test): prepare worktree GC child runtime (#155928) fix(ui): open browser cards after delayed panel renders (#153253) fix(update): retain the running updater by hard link instead of copying the package (#155977) feat(decisions): add explicit evaluation and Labs opt-in foundation (#155134) fix(state): preserve lifecycle custody across worker dispatch improve: reuse shared tooling fixtures and defer legacy updater proof (#155731) improve(ui): reduce real-Gateway test preparation (#155979) perf(state): move session RPC SQL off the Gateway main thread (#155740) docs(freebsd): explain native Codex runtime limits (#155980) fix(qa): count Code Mode nested tool activity as transcript tool evidence (#155976) ...
What Problem This Solves
Snapshot ownership checks spend several seconds loading TypeScript in fresh subprocesses.
User Impact
There is no product behavior change. The tests finish sooner while retaining their process ownership and race coverage.
Why This Change Was Made
Register the snapshot, staging, and logger import roots with the existing invocation-owned compiler and resolve prepared JavaScript entries for finite runs. All 14 case bodies, 33 fresh process starts—including 24 orphan-race roles—parent SIGKILLs, tokens, IPC/file barriers, assertions, and deadlines remain unchanged. Standalone/watch runs retain the existing source fallback.
Evidence
Natural ABBA at
f0d26603a5c1210dab73e4362b017eccdd585931used one configured Blacksmith Testbox, Node 24.19.0, four CPUs, 16.56 GB RAM, and the default cache policy. Every arm passed all 14 cases. Times are seconds:Worker preparation overlaps collection; these phases are not additive. The first pair reduced command time by 23.8%, with nearly identical collection/preparation cost. A2 slowed broadly, including compilation and unchanged cases; its cause is unproven, so the larger aggregate reduction cannot be attributed solely to this patch. ABBA run.
Correctness qualification on
85a481530c44cebb0736f9bf00a9da18cd786fcfretained the identical four-file patch. Temporarily removing parent-token admission made both source and prepared execution fail the same originalcopyExistsassertion in the first inspection cell. Production bytes were restored and verified before positive proof:f0d266.Qualification run. All 53 pinned source hashes and 60 qualification artifact entries verified. Two earlier capture-harness startup attempts stopped before collection and executed zero tests; their failure archives remain preserved. Stock-reporter qualification completed successfully, and all benchmark/qualification leases were verified stopped.
Published-head CI cost
Exact-head CI passed on
02539aae99963cd3765bbc7b9c265718b6d1ebf9, with both requiredopenclaw/ci-gateentries successful. In checks-node-compact-small-11, all 14 snapshot ownership cases passed, with 6.926 seconds of summed rounded case time; the orphan-race case took 3.471 seconds. These are verbose case durations, not a standalone file command wall or a new before/after comparison. The earlier 22.622-second standalone qualification cost remains bound to its recorded source. The CI job executed merge259b6564b1a7ed80cc799b8053544de85ab1e187into maind30f66fc26f9203c9ea4debf81f64b1757d18a9a.