Skip to content

test(canopen): say where the block-upload deadline test aborted - #241

Merged
dborgards merged 3 commits into
mainfrom
claude/nifty-franklin-01nn21
Sep 29, 2026
Merged

dborgards merged 3 commits into
mainfrom
claude/nifty-franklin-01nn21

Conversation

@dborgards

Copy link
Copy Markdown
Owner

What does this change?

Sdo_BlockUpload_Server_Deadline_Measures_Peer_Idle_Time_Not_The_Whole_Transfer failed once on CI at NotBe(CsAbort) without saying which of the 26 gaps it was or what the abort code was (#240). The failure now reports the aborted object, the abort code, the sub-block index, the time between the abort and the last frame the peer sent, and the time into the transfer, so the next occurrence says whether the deadline fired early (a re-arm defect) or at a random point (host stall). FrameTap records each frame's arrival time so the idle time is not measured at dequeue.

This does not fix the underlying cause, which is still unknown. The issue stays open; the commit uses Refs #240, not Closes.

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 (! in the title, plus a BREAKING CHANGE: footer explaining the migration)

Checklist

Also run locally: dotnet format CanKit.Pro.sln --verify-no-changes and dotnet pack with eng/verify-packages.py.

🤖 Generated with Claude Code

https://claude.ai/code/session_016EcWb8FeLKbGWkDkZFYnvp


Generated by Claude Code

Sdo_BlockUpload_Server_Deadline_Measures_Peer_Idle_Time_Not_The_Whole_Transfer
failed once on CI at NotBe(CsAbort) without saying which of the 26 gaps it was
or what the abort code was. The failure now reports the aborted object, the
abort code, the sub-block index, the time between the abort and the last frame
the peer sent, and the time into the transfer. FrameTap records each frame's
arrival time so the idle time is not measured at dequeue.

Refs #240

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EcWb8FeLKbGWkDkZFYnvp
@cursor

cursor Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes to failure messages and timing in a CANopen SDO correctness test; no library or runtime behavior is modified.

Overview
Improves diagnostics only for the flaky CI failure in Sdo_BlockUpload_Server_Deadline_Measures_Peer_Idle_Time_Not_The_Whole_Transfer (#240). A generic NotBe(CsAbort) check is replaced with FailIfAborted, which fails with the aborted OD entry, abort code, how many sub-blocks completed, ms since the last peer frame (using frame arrival time, not dequeue time), and elapsed transfer time versus SdoServerTimeout and the ACK gap—so a repeat failure can distinguish an early deadline (re-arm bug) from a random stall.

The shared FrameTap helper now queues (data, arrival timestamp) and exposes LastArrival on Next(), and the test logs peer send times in peerFrames for idle-time math. No production SDO behavior changes; #240 remains open.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-09-29T20:10:03.811446Z 2ab4733 Manual request
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48e8517008

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/CanKit.Pro.Tests/TestCases/CANopen/CanOpenSdoCorrectnessTests.cs Outdated
@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The abort diagnostics of the block-upload deadline test covered only the
segment reads. A server timeout in the gap after the 25th segment is queued
behind the final ACK and was consumed as the end frame, so it failed the
generic end-frame assertion without the abort code or timing. Both reads now go
through one check.

Refs #240

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EcWb8FeLKbGWkDkZFYnvp

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ab5d89a05

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/CanKit.Pro.Tests/TestCases/CANopen/CanOpenSdoCorrectnessTests.cs Outdated
The abort diagnostics of the block-upload deadline test recorded each peer frame
after Send returned. If the test thread was descheduled in between, the server
could time out and its abort arrive before that timestamp; the frame was then
excluded and the idle time reported from the preceding one. Taking the timestamp
before the send keeps it at or before the frame's arrival. With a 700 ms stall
injected after an ACK and a 300 ms server timeout, the message read 402 ms
before and reads 301 ms after.

Refs #240

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016EcWb8FeLKbGWkDkZFYnvp

Copy link
Copy Markdown
Owner Author

@codex review

Head 2ab4733 carries the fixes for both of your earlier findings, and no review from you on it has appeared yet.


Generated by Claude Code

@dborgards
dborgards merged commit cbd2d72 into main Sep 29, 2026
12 checks passed
@dborgards
dborgards deleted the claude/nifty-franklin-01nn21 branch September 29, 2026 20:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbd2d72d24

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +150 to 151
peerFrames.Add(System.Diagnostics.Stopwatch.GetTimestamp());
Send(rawBus, CanOpenCobId.SdoRx(0x02), SdoBlockFrames.BuildSubBlockAck(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Timestamp ACKs when they actually reach the server

The fresh pre-send placement in 2ab4733 only reverses the original race: if the runner is descheduled after this timestamp is added but before Send executes, the server can time out while the ACK has not yet been transmitted. Because that timestamp still precedes the abort's arrival, Last(...) treats the unsent ACK as the latest peer frame and reports roughly serverTimeout - gap (about 1.9 s here) rather than the real 2 s idle period, making a host stall look like an early deadline—the exact distinction these diagnostics are intended to establish. Record the ACK at its actual transmission or server-side observation instead.

Useful? React with 👍 / 👎.

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.

2 participants