-
Notifications
You must be signed in to change notification settings - Fork 791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix race between CompleteAsync and call dispose #1429
Conversation
var sentEndStreamCount = lastLogs.Count(l => | ||
{ | ||
// This is HTTP/2 specific. If this test is run with HTTP/3 then this check will need to be updated. | ||
if (l.EventId.Name == "Http2FrameReceived" && | ||
l.State is IEnumerable<KeyValuePair<string, object>> state) | ||
{ | ||
var frameType = state.Single(s => s.Key == "type").Value.ToString(); | ||
var flags = state.Single(s => s.Key == "flags").Value.ToString(); | ||
|
||
if (frameType == "DATA" && flags == "END_STREAM") | ||
{ | ||
return true; | ||
} | ||
} | ||
|
||
return false; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only way I could figure out how to unit test this. I think if this test becomes troublesome then it could be deleted.
@@ -996,5 +997,90 @@ async Task WaitForAllStreams(IAsyncStreamReader<DataMessage> requestStream, ISer | |||
} | |||
} | |||
#endif | |||
|
|||
[TestCase(2)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might've missed the nuance in the issue text but why are we testing on iterations up to 2
and 20
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The race condition happened randomly.
When I was testing, I had 2 iterations so the logs weren't too long in one test run, and 20 in another run to ensure the race condition didn't happen over many iterations.
I hate the test. Removed. |
Addresses #1394