Studying the test failure with the panic more closely, I think it is due to the inherent raciness caused by tests which spin up http servers, tcp servers etc in goroutines within the same test.

I think that what's happening is that the grpc server in the goroutine is not ready in time, so ProbeGRPC() fails, and the deferred s.GracefulStop() is called as the test exits. However, the goroutine is still in the s.Serve() loop, so... panic.

It's surprising how often a small delay is needed after spinning up such a test server in a goroutine. Such tests seem to pretty regularly fail on Debian CI infrastructure due to this raciness.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to