Repository navigation
Retry net48 UsageFixture tests on transport read timeouts - #731
Draft
todthomson wants to merge 1 commit into
Draft
todthomson wants to merge 1 commit into
todthomson wants to merge 1 commit into
Conversation
Adds a RetryOnTransportTimeout test attribute. It retries a test only when the test fails with a transport read timeout (socket TimedOut, or a polling request not collected in time); every other failure fails immediately. Retries apply on .NET Framework only by default. Each retry is reported in the test output and, under TeamCity, as a warning plus the 'halibut-transport-timeout-retry' build tag, so the cause stays visible. A retried test keeps its earlier attempt's trace log and is allowed to replace its trace logger. The attribute is applied to the UsageFixture tests whose net48 timeouts have been blocking the nightly Full Chain (LEV-2173, LEV-2244, LEV-2245, LEV-2246). Tests cover the classifier and the retry behaviour. Refs LEV-2253 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CQ12HPMmHGEcvKjdG43mj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Since mid-October the Halibut nightly chain (Full Chain and Nightly) has been reported as "failed to start" every few days. Each time, one
UsageFixturetest on net48 has failed with a transport read timeout:HalibutClientException→IOException→SocketException, underMessageExchangeStream.ReceiveResponseAsync/RewindableBufferStream.ReadAsync. That fails the test build, which blocks CreateRelease, so the chain never starts.The failures were filed per test variant (LEV-2173, LEV-2244, LEV-2245, LEV-2246) and are now consolidated in LEV-2253. The root cause is still being investigated. This PR only stops a single timeout from blocking the whole nightly.
Results
[RetryOnTransportTimeout]NUnit attribute. It retries a test only when it fails with a transport timeout: aSocketExceptionwithSocketError.TimedOutanywhere in the exception chain, the net48 "did not properly respond after a period of time" message, or "polling endpoint did not collect the request within the allowed time". Assertion failures, protocol errors, connection refused and anything else fail immediately. NUnit's built-in[Retry]can't be used because it only retries assertion failures.#if NETFRAMEWORK). On net10 tests run once, exactly as before.WARNINGmessage and##teamcity[addBuildTag 'halibut-transport-timeout-retry'], so affected builds can be counted.UsageFixturetests behind the duplicate issues:OctopusCanSendMessagesToTentacle_WithEchoService,OctopusCanSendMessagesToTentacle_WithSupportedServices,StreamsCanBeSentandLargeMessages.SetUp.SerilogLoggerBuilderno longer throws "test is being run multiple times" whenCurrentRepeatCount > 0.TraceLogFileLoggerappends instead of deleting on a retry, so the failed attempt's trace log is kept.Refs LEV-2253
How to review this PR
Quality ✔️
RetryOnTransportTimeoutAttribute. It uses oneWrapfor bothIWrapTestMethod(captures the exception) andIRepeatTest(the retry loop), and tells them apart by whether the command is aTestMethodCommand.TransportTimeoutClassifiermatches are narrow enough.Testing done: on net10 (Linux), the new
TransportTimeoutClassifierFixtureandRetryOnTransportTimeoutAttributeFixturetests pass, along with all ofUsageFixture(108 tests in the filter, all passing). The retry fixture confirms a test that times out once passes on retry and thatSetUpruns again on each attempt.Not yet verified: the net48 build (no .NET Framework reference assemblies were available where this was written), and whether the
##teamcityservice messages are picked up throughdotnet test. CI on this PR will show both.Pre-requisites
Generated by Claude Code