Repository navigation
test: reuse performance workflow repository fixtures - #133356
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 1:05 PM ET / 17:05 UTC. ClawSweeper reviewWhat this changesThe PR caches a baseline local Git fixture for default performance-workflow tests and keeps report runners alive after re-raising a termination signal. Regression provenancePossible regression — probable (reproduction; failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the introduced fixture and cancellation changes are coherent, with no discrete correctness finding; exact-head CI is still running and this maintainer-labeled PR requires normal maintainer handling. Priority: P3 Review scores
Verification
How this fits togetherPerformance-workflow tests create local Git repositories, execute CI workflow steps, and verify report publication and cleanup. Project and extension-batch runners aggregate Vitest work and must propagate child cancellation to the calling process. flowchart LR
A[Performance test case] --> B[Fixture builder]
B --> C[Local Git workspace]
C --> D[Workflow lifecycle step]
D --> E[Report cleanup assertions]
F[Child termination signal] --> G[Runner finalizer]
G --> H[Re-raised process signal]
H --> I[Parent observes termination]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +29, Other 0. Total +29 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the shared template and common lifetime wait, then merge only after the exact-head CI rollup is green. Do we have a high-confidence way to reproduce the issue? Yes: the existing report-owner fixture sends SIGTERM to ordinary and batch runners and observes the outer signal, child cleanup, and suppressed later work; the PR body records repeated Linux runs of that path. Is this the best way to solve the issue? Yes: both finalizers reuse the established process-lifetime primitive, while copied fixtures remain independent and preserve fresh setup for exceptional scenarios. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against 86b6ec0afa2c. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review The CI follow-through is now published. The workshop timestamp prerequisite landed independently in #133153; its duplicate was removed here. This PR also repairs the Linux cancellation race in both report finalizers, with unchanged regression assertions, 20 repeated real cancellations, all 59 report-owner cases, and the composed changed gate passing. A fresh exact-head CI run is required before landing. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* test: reuse performance workflow repository fixtures * fix(test): preserve signal exits after report finalization
What Problem This Solves
Developers running the performance-workflow Git lifecycle tests rebuild identical local repository history for nearly every case. This adds repeated Git process startup before the actual lifecycle checks.
Why This Change Was Made
Create the default initial history once, then copy the complete workspace into each case's independent directory. Each copy owns its files, refs, index, objects, and local remote. Destination paths are rebuilt per case. Absent, malformed and duplicate baseline fixtures still use their original fresh setup; mode-specific publication, race setup, and all process ownership checks remain unchanged. The existing temporary-directory tracker owns the immutable template and clears it after the suite.
User Impact
Faster fixture execution, plus an evidence-backed repair for an existing CI cancellation failure. No product behavior, dependency, sharding, workers, concurrency, test selection, assertion weakening, or deadline changes. The test runners now retain their process lifetime until cancellation finishes with the original signal. The 105-case lifecycle suite removes 1,000 repeated bootstrap Git launches while retaining every real process tree, fault and cleanup boundary.
Evidence
Six alternating default-fixture measurements: median 312.074 ms before / 44.891 ms after. A second six-pair measurement against the formatted candidate: 281.031 ms / 38.943 ms. Every pair favored the candidate. These are fixture execution measurements, not whole-CI speedups.
All 105 original lifecycle cases passed before and after:
node scripts/run-vitest.mjs run test/scripts/openclaw-performance-git-lifecycle.test.ts. The first full runs were 560.794 s / 379.176 s; that larger difference includes warmup/host noise and is not attributed entirely to this patch.All 39 sibling workflow tests passed:
node scripts/run-vitest.mjs run test/scripts/openclaw-performance-workflow.test.ts.Supplemental isolated probes compared full tree/index/config/branch/history shapes, independent file identities, cross-copy mutation isolation, all specialized baseline/race variants, destination-local transport paths and registered cleanup.
Independent source review and Codex autoreview found no accepted findings. Product LOC: +0/-0; runner tooling: +8/-8 (net zero); test support: +47/-18.
node scripts/check-changed.mjs -- test/scripts/openclaw-performance-workflow.test-support.tspassed after a frozen-lockfile install refreshed stale local Telegram types. No dependency manifest or lockfile changed. The composed 26-step changed gate passed on Linux, including core-test, script and test-support typechecks. Removing the unpublished workshop duplicate afterward left all three retained changed files and the shared wait helper byte-identical to that validated source.CI Follow-through
The first exact-head run exposed a timestamp tie in the unchanged workshop test
rejects and quarantines proposals without touching active skills. The fix has since landed independently in #133153 at 4bc25d7. This PR drops its unpublished duplicate fixture repair and preserves the canonical main change; no workshop repair is attributed to this PR.The same CI run also failed the unchanged real
batch-cancelcase: the child recorded SIGTERM, but the outer runner exited normally with code 1. An exact-source Linux Node 24.19 reproduction failed on its sixth case; a lighter diagnostic reproduced it on its second case. The report finalizer's singlesetImmediatecould return before Rolldown'ssignal-exithandler received the re-raised signal. That dependency must close its trace subscriber, remove its own handlers, and re-raise the fatal signal. Both project and plugin-batch finalizers now reuse the existing dependency-freewaitForever()primitive after self-signalling, keeping the event loop referenced until signal termination. No foreign listener is removed, no deadline is enlarged, and no delay or retry is added. All 20 repeated Linux cancellations passed (16 batch, 4 ordinary), including actual outer/child SIGTERM, no surviving worker, no second invocation, and no aggregate publication. Existing cancellation tests remain unchanged. All 59 report-owner integration cases passed throughpnpm test test/scripts/vitest-report-owner.test.tson the same Linux worker. The initial direct-Node suite invocation lacked pnpm executable provenance inside its isolated environment; the normal pnpm entrypoint corrected that invocation without any source change. Independent review and Codex autoreview found no accepted findings.The failed compact shards were diagnosed before a fresh run: the cancellation failure has before/after evidence and the workshop prerequisite is already on main. The composed exact-head run is now green. The latest ClawSweeper rank-up move, complete exact-head CI, is satisfied without a blind rerun or CI waiver.
A second candidate lifecycle run passed all 105 tests in 368.843 seconds. The matching repeated original baseline passed 104/105 but failed an existing supervisor-error path after 50.88 seconds; it is excluded from timing claims. Its valid terminal report proved cleanup, but the JSON-only reporter did not retain the report's error text. Named follow-up: preserve that error in the supervisor assertion diagnostics. No timeout increase or assertion weakening is included here. The stable performance claim remains the paired fixture-setup measurements above.
Final validation
Exact head
f7f47b2d321ff74727d53e6d89e0bc0bac3f86f4passed CI 33323988415, including Linux and macOS. The latest ClawSweeper review has no actionable findings; its request to wait for exact-head green CI is satisfied. Independent maintainer review and Codex autoreview are clean. The retained fixture and signal-finalizer source matches the locally validated bytes.No workshop test change is included: its prerequisite landed independently in #133153. The observer-startup and supervisor-error diagnostic follow-up is being validated separately and is not part of this head.