Repository navigation
test(a2ui): queued SVG decode test fails on a slow runner because it checks total elapsed time - #2170
Conversation
…checks total elapsed time Load_QueuedBehindBusyDecodeSlots_CompletesOnceASlotFrees asserted that a 500 ms queue hold plus one decode finished within 2.5 s of wall-clock time, which a loaded runner exceeded. Prove the queueing causally instead: with every decode slot held the load is pending, the single freed slot is handed directly to it (SemaphoreSlim CurrentCount stays 0), and it then decodes within the existing named SingleDecodeBound and returns its slot. Name the decode concurrency (MediaResolver.SvgDecodeConcurrency) so the test can require every slot idle at start, and lower the file's fixed-delay baseline. 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 replaces a queued SVG decode test’s elapsed-time assertion with queue hand-off checks and names the existing three-slot concurrency limit. Example: A busy runner completes a queued trivial SVG load in 2.844 seconds.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete timing-sensitive test still present on main. The introduced diff preserves product behavior, and no actionable correctness or security defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherMediaResolver converts permitted A2UI image URLs into native WinUI image sources; SVG decoding uses a shared three-slot semaphore, and the changed native test exercises that queue directly. flowchart LR
A[A2UI image URL] --> B[MediaResolver]
B --> C[SVG input validation]
C --> D[Three slot decode queue]
D --> E[Native SVG decoder]
E --> F[WinUI image source]
Technical reviewBest possible solution: Retain the causal queue assertions and unchanged product limit, with the existing native test lane validating the candidate. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the 500 ms timer and 2.5-second total bound; the author reports matching CI and injected-stall failures, but this review did not independently execute them. Is this the best way to solve the issue? The smallest complete fix replaces runner-speed measurement in the existing test with observable queue transitions while preserving successful native decoding and the separate single-decode bounds. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5e8824267216. 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. Review metrics
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 13, 2026, 9:44 AM ET / 14:44 UTC. |
What Problem This Solves
Fixes:
A2UISvgTests.Load_QueuedBehindBusyDecodeSlots_CompletesOnceASlotFreesfailed onmain30e8a49f(run 43423590868, job 131879466615) with: "queue wait 00:00:00.5 plus a trivial decode took 00:00:02.844 (>00:00:02.5)".User Impact
User impact: none. The product change only replaces the literal
3with a named constant, so behavior is unchanged. This removes a false CI failure.Why This Change Was Made
The test held every decode slot, released them from a timer after 500 ms, and asserted that the whole operation finished within 2.5 s of wall-clock time. On a loaded runner, the UI-thread dispatch alone can exceed that, so the test measured runner speed rather than queueing.
MediaResolver.LoadImageAsyncruns synchronously for adata:SVG until it reachess_svgDecodeSemaphore.WaitAsync. The test now proves the queue behavior causally:MediaResolver.SvgDecodeConcurrencyslots to be idle first, so no earlier work can take part.CurrentCount == 0.SemaphoreSlim.Releasehands a freed slot directly to a queued async waiter, so the count stays at 0 only if the load was waiting in the queue.SingleDecodeBound(SvgRenderTimeoutplusOPENCLAW_UI_SVG_DECODE_SLACK_SECONDS). A timeout reports diagnostics.SvgImageSourcewith no warnings, andCurrentCount == 1(the load returned its slot).MediaResolvernow names its concurrency (internal const int SvgDecodeConcurrency = 3). The timing ratchet baseline for this file drops from 2 to 1 because theTask.Delaywas removed.Evidence
WaitAsyncandReleasein the product, so loads no longer queue. The new test fails at the hand-off check: "Expected: 0, Actual: 1".Change Type
Scope
winnodeRequired proof pools
none: test change plus a product constant with no behavior change. CI's UI job runs this test. No custom pool applies.Validation
Tested on base
49a9747awith the final tree (commit2962d433; the tested tree is identical).mainis now5e882426, with no changes to these files.dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~A2UISvgTests.Load_QueuedBehindBusyDecodeSlots_CompletesOnceASlotFrees": 5 consecutive passes.dotnet test tests/OpenClaw.Tray.UITests --no-build --filter "FullyQualifiedName~A2UISvgTests": 23 passed, 0 failed..\scripts\validate-test-timing-patterns.ps1: passed. The only remaining warning is about an unrelated Shared test file../build.ps1: all builds succeeded.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,441 passed, 0 failed.OPENCLAW_TRAY_*roots under the shared desktop lock. The real OpenClawTray profile manifests were unchanged.SemaphoreSlim.Releasehands the slot to the queued waiter synchronously in .NET 10. This is long-stable implementation behavior, not a documented guarantee.Real Behavior Proof
2962d433.Yes/No/N/A) N/ASecurity Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation:Compatibility and Migration
Yes/No) YesYes/No) NoYes/No) NoReview Conversations