grpc-go icon indicating copy to clipboard operation
grpc-go copied to clipboard

fix: Flaky test ClientSendsAGoAway

Open aranjans opened this issue 9 months ago • 1 comments

Fixes #7160 fix: goaway_test/TestClientSendsAGoAway didn't use to wait for channels to be ready and which is why sometimes it was not able to read the frame and eventually result in test failure. This PR change make sure we read the frame only when the channel's state becomes READY.

RELEASE NOTES: n/a

aranjans avatar May 10 '24 10:05 aranjans

Probably need some more description about the fix

purnesh42H avatar May 10 '24 11:05 purnesh42H

From chat offline:

Actually, this structure of the test actually proves there is a bug here that I don't think you're fixing If a connection is created, we want it to reliably get a goaway. We know a connection exists otherwise we won't get to this part of the code, because the channel passes it along

So I think the test is correct (though it can still be simplified), but there is a race in the code that prevents the GOAWAY from being sent in some cases.

dfawley avatar May 13 '24 15:05 dfawley

@dfawley updated the PR.

aranjans avatar May 14 '24 07:05 aranjans

Update: this is the code where we are hardcode closing the transport. Will update the PR with the change where we send goAway frame in this case as well.

aranjans avatar May 14 '24 16:05 aranjans

@dfawley As per our discussion offline, we won't be waiting for all the transport conn to close down. So this PR's change is ready to review as it just makes sure we are waiting for the clientconn to be READY.

aranjans avatar May 16 '24 10:05 aranjans