Skip to content

test(uds): clock functional confirmation deadlines - #479

Merged
dborgards merged 1 commit into
mainfrom
fix/uds-confirmation-clocks-362
Oct 27, 2026
Merged

dborgards merged 1 commit into
mainfrom
fix/uds-confirmation-clocks-362

Conversation

@dborgards

Copy link
Copy Markdown
Owner

What does this change?

Refs #362. UdsFunctionalClientTests now drive CAN confirmation deadlines on their WindowClock as well as P2, P2* and collection windows. The main OpenOnClock factory and both direct service constructions use the real RawCan service through ClockedCanBusService; the existing 500 ms N_As and explicit per-test budgets remain unchanged, as does matching-echo confirmation.

ClockedCanBusService can borrow a clock-owned timer actor. WindowClock supplies a separate confirmation actor so a shorter N_As timer cannot shadow the protocol actor's earliest P2/collection timer. Disposing the service cancels its sends and removes its deadline handles, while the external clock retains its actor. The existing ManualTimeSource constructor continues to own its actor.

Three new tests verify functional N_As at exactly 500 ms of virtual time with a positively armed P2 window, separation of a 500 ms confirmation from a one-second protocol timer, and reuse of the clock-owned actor after service disposal. Three restored source mutations fail at runtime: restoring the old real-time factory binding, disposing the borrowed actor, and using the protocol actor for confirmations.

Only test infrastructure and tests change. The ordinary UdsClient ClockPair uses a synchronous, non-echo virtual adapter and has no active RawCan confirmation timer; it is unchanged. #362 remains open for the final bounded-hold work and inventory audit.

Type of change

  • feat — new behaviour (minor release)
  • fix / perf — bug or performance fix (patch release)
  • docs / test / refactor / chore / ci — no release
  • Breaking change

Checklist

Validation: 3,043 net10 tests, net48 compilation, nine verified packages, 50 engineering tests and requirements traceability; 257 focused UDS/helper cases. Production diff is empty; final CI coverage, Codecov partials/missing and all review comments will be checked before merge.

@cursor

cursor Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to test infrastructure and assertions; no production code or public API surface is modified.

Overview
Test-only change (refs #362): functional UDS tests now run Raw CAN confirmation deadlines on the same virtual clock as P2/P2* and collection windows, without changing production APIs.

ClockedCanBusService gains a constructor that borrows a caller-owned ProtocolActor for confirmation timers; disposal only tears down the actor when the service created it (ManualTimeSource path unchanged). WindowClock adds a dedicated ConfirmationActor so shorter N_As deadlines do not steal the “next timer” slot from the protocol actor used for UDS windows.

UdsFunctionalClientTests wire buses through clock.OpenService (ClockedCanBusService) instead of bare CanBusService with real-time timestamps. New coverage asserts N_As expiry at 500 ms virtual time, isolation between confirmation and protocol timers, and that the borrowed actor remains usable after service disposal.

Reviewed by Cursor Bugbot for commit 1fcbfc5. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T03:03:01.653163Z 1fcbfc5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dborgards
dborgards merged commit fde5e16 into main Oct 27, 2026
14 checks passed
@dborgards
dborgards deleted the fix/uds-confirmation-clocks-362 branch October 27, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant