Repository navigation
test(hosting): mark the handoff request's arrival before the release closes it - #986
Merged
Merged
Conversation
…closes it The concurrent-fresh-sidecar test released the held responses before it marked the ticket request's arrival. On net472 the handler does not retry a connection that closed without a response, so PrepareAsync could fail, find the fresh sidecar and return before the arrival was marked, and the arrival assertion read false. The response that marks the arrival is now built before the release.
Merged
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.
Summary
ServicePtyHandoffTests.PrepareAsync_Should_Return_When_A_Concurrent_Caller_Published_A_Fresh_Matching_Sidecarfailed once on net472 in run 45279094808, at the arrival assertion: "Expected to be true but found False".The race. The first ticket request's handler:
ReleaseResponses(), which closes every client socket, this request's included;Pending(arrived), which marks the arrival.On net472 the handler does not retry a connection that closed without a response (the test's own
#if NETnote). SoPrepareAsynccould fail, re-check, find the fresh sidecar and return between steps 2 and 3. The test then saw the preparation finish before the arrival.The fix is the test's ordering only. The handler reads whether this is the first request, builds the
Pending(arrived)response that marks the arrival, and only then seeds and releases. There is no retry and no wider wait. The rest of the test, including the net retry assertion, is unchanged.Test
PrepareAsynchas completed (bounded).ServicePtyHandoffTests: 36 of 36 on net472, net10.0 and net11.0.