test(uds): drive the O and Q expired-deadline tests on a virtual clock - #190
Conversation
O_A_Suppressed_Send_Cancelled_Before_Confirmation_Still_Opens_Its_Window and Q_A_Stray_Pending_From_Before_The_Handoff_Still_Moves_Its_Services_Window each asserted a lower bound on the wall-clock gap between two sends, with a 5 ms margin. Q missed it by 64 us in 1 of 6 full-suite runs on main at c870139 (294.936 ms against >= 295 ms). StubChannel can now take the client's actor as its clock. Its stamps and its delays then run on that actor, and the client is opened on the same actor through the internal UdsClient.Create(channel, clock, ...). The tests step the clock one millisecond at a time. A send can then only be stamped later than the instant its window closed, never earlier. So the lower bound is a property of the client, not of the host, and needs no margin: - O: gap >= P2, where it was P2 - 5 ms. - Q: gap >= P2* - 2 ms, the 2 ms by which the stray 0x78 predates the second send, where it was P2* - 5 ms. Mutation checks: - A cancelled send restores like a refused one, leaving no window: O red, gap 30 ms. - The stray 0x78 is not routed: Q red, gap 149 ms. R keeps its wall clock. Since #187 its note follows the cancellation, so scheduling delay can only lengthen the gap it bounds. Refs #171 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013WJ8h1ahw4Nj5dYuEWy34s
PR SummaryLow Risk Overview
O and Q now use Reviewed by Cursor Bugbot for commit 3bc8e21. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What does this change?
Part of #171. Two tests in
UdsExpiredDeadlineTestsasserted a lower bound on the wall-clock gap between two sends, with only a 5 ms margin:O_A_Suppressed_Send_Cancelled_Before_Confirmation_Still_Opens_Its_WindowQ_A_Stray_Pending_From_Before_The_Handoff_Still_Moves_Its_Services_WindowQ is red on
mainitself. It failed 1 of 6 full-suite runs at c870139, missing the bound by 64 µs (294.936 ms against ≥ 295 ms). It is recorded on #171.How:
StubChannelcan take the client's actor as its clock, so its stamps and delays run on that actor.UdsClient.Create(channel, clock, …)from test(uds): run the P2/P2* and suppressed-window tests on a virtual clock #189.A send can then only be stamped later than the instant its window closed, never earlier. The lower bound becomes a property of the client, not of the host, and needs no margin:
Mutation checks:
R_…keeps its wall clock. Since #187 its note follows the cancellation, so scheduling delay can only lengthen the gap it bounds. The other tests in the file have margins of 100 ms and more and stay as they are.Type of change
feat— new behaviour (minor release)fix/perf— bug or performance fix (patch release)docs/test/refactor/chore/ci— no release!in the title, plus aBREAKING CHANGE:footer explaining the migration)Checklist
dotnet build CanKit.Pro.sln -c Releasesucceeds (with-p:CI=true; the net48 test leg also compiles)dotnet test CanKit.Pro.sln -c Releasepasses (net10.0, locally, 1220/1220)FR-RAW-031,ADR-7), if any (Replace wall-clock category-2 test sleeps (macOS flake risk) #171)🤖 Generated with Claude Code
https://claude.ai/code/session_013WJ8h1ahw4Nj5dYuEWy34s
Generated by Claude Code