Repository navigation
fix(tests): reduce settings publication flakes under load - #2359
Conversation
Co-authored-by: Copilot App <[email protected]>
|
🦞👀 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. What this changesThis PR moves blocking settings-publication test work onto dedicated threads and replaces short waits with configurable budgets. Example: A loaded CI runner executes SavedCallbacksRunOutsideSettingsSerialization.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a focused test-reliability improvement, preserves the concurrency contracts, and has no actionable introduced defects. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTray tests exercise SettingsManager persistence and SettingsStore notifications, checking that committed snapshots publish correctly while callbacks and concurrent edits overlap. flowchart LR
A[Concurrency tests] --> B[Dedicated workers]
B --> C[SettingsManager]
C --> D[Settings file and policy snapshot]
C --> E[Saved callbacks]
E --> F[SettingsStore notifications]
Technical reviewBest possible solution: Land the focused scheduling repair while retaining all existing publication, rollback, ordering, and origin assertions. Do we have a high-confidence way to reproduce the issue? GitHub records the affected test failures, but the author explicitly reports that local injection did not reproduce them and ThreadPool starvation remains a hypothesis. Is this the best way to solve the issue? Dedicated workers remove the identified scheduling dependency without changing production owners or weakening assertions, and the timeout setting reuses an existing test convention. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 15b4276c7d2c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 23, 2026, 2:59 PM ET / 19:59 UTC. |
…ersion7-coordinated-2355-20261124 * commit 'f86e395d5c8edbc968d8d6e789d1ac16a1124a80': fix(tests): read chat text from complete UIA snapshots (#2364) fix: reduce typing lag in long chats (#2343) fix(tests): wait for the Sessions gallery window (#2337) fix(migration): keep the shutdown request until the receiver reads it (#2360) fix(tests): isolate settings publication tests from ThreadPool pressure (#2359) fix: keep candidate builds from contending on GitHub environment exports fix(tests): prevent stale chat ink captures (#2357)
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
56cd925449ad7ca2c31e176e23ab239afce10ff8↓ No local reproduction of the CI failure; CI on this head is pending.
↓ Targeted injection did not reproduce the CI stack.
↓ No trace proves starvation caused the observed failures.
What Problem This Solves
Settings publication tests have repeatedly failed on CI under load, delaying validation of unrelated changes. Two tests timed out and another observed an unexpectedly completed operation in CI run 44961910362.
User Impact
No user-visible change. Developers get tests less dependent on shared ThreadPool availability.
Why This Change Was Made
Blocking test operations run on dedicated threads. Named, configurable wait budgets keep failures bounded, and the saved-callback test explicitly checks for a swallowed callback timeout. The affected class and helper path were swept for the same pattern.
Evidence
The 10-test class passed after rebasing, and the same patch passed repeated runs with both screenshot settings and CPU contention. Diagnosis-only, not reproduced: the class-6 ThreadPool-starvation hypothesis rests on the CI log and code shape, not a local reproduction. Targeted injection attempts did not produce the CI stack, so there is no RED/GREEN claim. The issue remains on watch.
Change Type
Scope
winnodeRequired proof pools
none: managed test-only change; no capacity-dependent custom Windows proof pool applies.Validation
The full suites and contention repetitions ran on the same uncommitted patch based on
9ced24fc53041648d696a86aaf8df55c4305e65e. The intervening base changes did not touch the affected test, settings store or callback code, or timing baseline. After rebasing to15b4276c7d2ce696918d5fa7a4cf5010db25c6a4, the build, focused class, and timing ratchet passed again..\build.ps1: passed after rebase.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: passed before rebase, 5,972 passed and 29 expected skips. An earlier invocation failed on a corrupted generated reference assembly; it was rebuilt and the suite passed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: passed before rebase, 6,938 passed.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --filter FullyQualifiedName~OpenClaw.Tray.Tests.SettingsSandboxPublicationTests: passed after rebase, 10 passed.scripts\Invoke-CiTestSoak.ps1 -SelectionPath <selection>underInvoke-WithDesktopLock.ps1: before rebase, 10 repetitions passed with screenshots off and 10 with screenshots on, including three CPU-contended runs in each matrix.pwsh -NoProfile -File .\scripts\validate-test-timing-patterns.ps1: passed after rebase.git --no-pager diff --check: passed after rebase.Claude Opus 5.5 and GPT-6 Astra reviewed the patch independently. An earlier callback timeout finding was fixed and reviewed again; the final review reported no medium-or-higher findings. Two low-only suggestions were not incorporated.
Real Behavior Proof
56cd925449ad7ca2c31e176e23ab239afce10ff8, based on15b4276c7d2ce696918d5fa7a4cf5010db25c6a4.Failed: 0, Passed: 10, Skipped: 0, Total: 10.Yes/No/N/A): N/A.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): Yes, optional test-onlyOPENCLAW_TRAY_TEST_CONCURRENCY_TIMEOUT_SECONDS.Yes/No): NoReview Conversations