Skip to content

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Sep 29, 2021

Addresses #1394

Comment on lines 1063 to 1079
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;
});
Copy link
Member Author

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.

}
#endif

[TestCase(2)]
Copy link
Contributor

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?

Copy link
Member Author

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.

@JamesNK
Copy link
Member Author

JamesNK commented Sep 30, 2021

I hate the test. Removed.

@JamesNK JamesNK merged commit ac3b3f4 into grpc:master Sep 30, 2021
@JamesNK JamesNK deleted the jamesnk/completeasync-race branch September 30, 2021 18:21
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