Skip to content

test: reuse performance workflow repository fixtures - #133356

Merged
steipete merged 2 commits into
mainfrom
codex/test-perf-performance-fixtures
Aug 30, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/test-perf-performance-fixtures

Conversation

@steipete

@steipete steipete commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

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.ts passed 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-cancel case: 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 single setImmediate could return before Rolldown's signal-exit handler 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-free waitForever() 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 through pnpm test test/scripts/vitest-report-owner.test.ts on 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 f7f47b2d321ff74727d53e6d89e0bc0bac3f86f4 passed 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.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 30, 2026
@steipete
steipete marked this pull request as ready for review August 30, 2026 15:56
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 30, 2026
@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 1:05 PM ET / 17:05 UTC.

ClawSweeper review

What this changes

The PR caches a baseline local Git fixture for default performance-workflow tests and keeps report runners alive after re-raising a termination signal.

Regression provenance

Possible regression — probable (reproduction; failure trace; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: f7f47b2d321ff74727d53e6d89e0bc0bac3f86f4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is narrowly scoped and its existing process-boundary coverage is meaningful; completion of exact-head CI remains the merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal runner/test-support PR is exempt from the external-contributor proof gate; its PR body nevertheless records repeated Linux cancellation evidence for the changed entrypoints.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal runner/test-support PR is exempt from the external-contributor proof gate; its PR body nevertheless records repeated Linux cancellation evidence for the changed entrypoints.
Evidence reviewed 7 items Fixture isolation: Default cases copy a completed workspace template; baseline variants and duplicate cases keep fresh setup, and per-case workflow mutations occur after the copy.
Cancellation owner path: Both report-owning runners remove their temporary signal observers, re-signal the process, then await the existing referenced lifetime wait.
Wait primitive contract: The shared primitive deliberately keeps a referenced interval while returning a pending promise, so Node does not exit before the re-raised signal is handled.
Findings None None.
Security None None.

How this fits together

Performance-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]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still in progress, so the combined fixture and runner behavior has not yet received complete CI confirmation.
  • Complete next step (P2) - No repair is indicated; wait for exact-head CI and normal maintainer merge review.
Agent review details

Security

None.

PR surface

Tests +29, Other 0. Total +29 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 47 18 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 8 8 0
Total 3 55 26 +29

Review metrics

Metric Value Why it matters
Production versus test-support LOC production +0/-0; runner scripts +8/-8; test support +47/-18 Runtime product code is unchanged; the runner substitution is net-neutral and fixture caching is confined to test support.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the shared template and common lifetime wait, then merge only after the exact-head CI rollup is green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P3: This is low-risk internal test-fixture and runner maintenance without a direct user-facing product change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal runner/test-support PR is exempt from the external-contributor proof gate; its PR body nevertheless records repeated Linux cancellation evidence for the changed entrypoints.

Evidence

What I checked:

Likely related people:

  • unknown: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the current exact-head CI rollup to finish green before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-30T16:04:01.500Z sha 952d7f3 :: needs maintainer review before merge. :: none

@steipete steipete self-assigned this Aug 30, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 30, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@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.

@clawsweeper

clawsweeper Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit db963ca into main Aug 30, 2026
163 of 164 checks passed
@steipete
steipete deleted the codex/test-perf-performance-fixtures branch August 30, 2026 17:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 31, 2026
* test: reuse performance workflow repository fixtures

* fix(test): preserve signal exits after report finalization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant