What is the case
IsoTpChannelIntegrationTests.A_Failing_Subscription_Ends_The_Inbox_With_Its_Failure (added in #261) failed once on the ubuntu-latest leg of #269 (run 37143947428, head d9c4eae; the diff there is CANopen only): Expected collection to contain a single item, but the collection is empty., i.e. the last assertion of the test.
The test waits for ReceiveAsync to fault and then reads the list that BackgroundExceptionOccurred fills. RunReaderAsync posts the loss to the inbox first and raises the report afterwards, so the receive can complete before the report has been raised; the assertion then races the raise. The test does not wait for the report, which is a defect in the test (a race of my own making in #261, not of the product code): the product contract is "the inbox ends with the failure, and the failure is reported", with no order promised between them.
Suggested change
Collect the report through a TaskCompletionSource and await it (with the usual timeout) instead of reading the list right after the receive completes.
Test-only. Per the working agreement this is debt from #261 and is worked right after the pull request in hand (#269).
🤖 Generated with Claude Code
What is the case
IsoTpChannelIntegrationTests.A_Failing_Subscription_Ends_The_Inbox_With_Its_Failure(added in #261) failed once on theubuntu-latestleg of #269 (run 37143947428, headd9c4eae; the diff there is CANopen only):Expected collection to contain a single item, but the collection is empty., i.e. the last assertion of the test.The test waits for
ReceiveAsyncto fault and then reads the list thatBackgroundExceptionOccurredfills.RunReaderAsyncposts the loss to the inbox first and raises the report afterwards, so the receive can complete before the report has been raised; the assertion then races the raise. The test does not wait for the report, which is a defect in the test (a race of my own making in #261, not of the product code): the product contract is "the inbox ends with the failure, and the failure is reported", with no order promised between them.Suggested change
Collect the report through a
TaskCompletionSourceand await it (with the usual timeout) instead of reading the list right after the receive completes.Test-only. Per the working agreement this is debt from #261 and is worked right after the pull request in hand (#269).
🤖 Generated with Claude Code