grpc-go
grpc-go copied to clipboard
Fix possible race in Keepalive test: KeepaliveClientClosesWithActiveStreams
KeepaliveClientClosesWithActiveStreams test creates a server which does not respond to keepalive pings, and makes sure that the client closes the transport even when there is an active stream. However there is a possibility of a race here.
In the test we assign a large enough ClientParameters.Time. However this does not guarantee that a stream can be created successfully before the timeout hits. This is because with the NoPingServer we do not have a configurable way to switch between a ping/noping server.
This way we can verify that the "no ping server" actually respond to pings until you set a flag, at which point it stops responding and the timeout kicks in to close the transport.
You can assign me
Sure! Please let me know if something doesn't make sense in the description. We can discuss the approach in this issue first before we send a PR out for review.
Hello @arvindbr8 I would like to look into this issue. If it's ok, please go ahead and assign it to me. One clarification question if you don't mind: , do you mean that, when toggled, the server should skip ping frames handling? If so, I might reuse http2Server and just flip handling ping frames according to the test settings.
Yes that should work. Assigning this issue to you @tobotg. Let us know if you have any further questions.