Repository navigation
perf(test): make Workshop contention deterministic - #124440
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for exact head
|
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 1:49 AM ET / 05:49 UTC. ClawSweeper reviewWhat this changesThe PR replaces timing-based Skill Workshop contention tests with deterministic checks for serialized reconciliation and lease-timeout results. Merge readinessKeep this maintainer-labeled PR open for normal review: the test-only patch preserves the real lease boundary while replacing scheduler-dependent waits with deterministic assertions, and no blocking correctness or security issue was found. Priority: P3 Review scores
Verification
How this fits togetherSkill Workshop lists and inspects proposed workspace skills, reconciling pending proposals under collection and target locks. The changed tests cover the tool-facing list path and the SQLite lease path that prevents reads from racing collection changes. flowchart LR
A[Workspace proposals] --> B[Skill Workshop list or inspect]
B --> C[Pending proposal reconciliation]
C --> D[Collection and target leases]
D --> E[SQLite state]
E --> F[Proposal result or timeout]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +8. Total +8 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the deterministic overlap factory and real SQLite timeout coverage, then refresh the branch and its focused Workshop validation against current main. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR improves deterministic test execution rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes. It tests list serialization at its reconciliation boundary while retaining the real SQLite lease path for timeout behavior; retaining wall-clock sleeps would be less reliable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6aa27d6ecd8f. LabelsLabel changes:
Label 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
|
|
Merged via squash.
|
What Problem This Solves
Two Skill Workshop contention regressions spend almost ten seconds near production lease deadlines: the list-tool test holds a collection lock for 4.6 seconds to detect accidental parallel reconciliation, and the real lease-timeout test waits the full five-second acquisition budget.
Why This Change Was Made
Split the invariants at their actual owners:
listSkillProposalsprocesses reconciliations serially.OPENCLAW_STATE_LEASE_TIMEOUTwithout sleeping.Real lock blocking, rollback serialization, and cross-process lease behavior remain covered by the collection and plugin lifecycle suites. Production code and lease policy are unchanged.
User Impact
Maintainer Skill Workshop test feedback is substantially faster and the serialization regression now fails immediately rather than indirectly near a deadline.
Evidence
Controlled same-Testbox A/B on
tbx_01m04g95378a8095c9gtat86j4, one excluded warmup plus two retained samples per state, the same two-file command, one worker, distinct filesystem module caches, import diagnostics, and/usr/bin/time -v:CPU and peak RSS were effectively flat, so this PR makes no resource-usage claim.
Validation:
Promise.allinlistSkillProposalsfails immediately withskill proposal reconciliations overlapped.OPENCLAW_STATE_LEASE_TIMEOUTfor both list and inspect callers.+0/-0; test LOC:+55/-47.Testbox hydration run: https://github.com/openclaw/openclaw/actions/runs/31928815959