fishy commented on code in PR #3811:
URL: https://github.com/apache/thrift/pull/3811#discussion_r3951152312
##########
lib/go/thrift/simple_server_test.go:
##########
@@ -168,8 +168,18 @@ func
TestNoHangDuringStopFromClientNoDataSendDuringAcceptLoop(t *testing.T) {
t.Fatalf("Failed to listen: %v", err)
}
+ // Closed once the server is processing the connection, which is after
+ // TSimpleServer added it to the wait group Stop waits on. Sleeping
+ // instead makes the test fail whenever the accept and the goroutine
+ // start take longer than the nap.
+ processing := make(chan struct{})
+ var processingOnce sync.Once
Review Comment:
use `sync.OnceFunc` instead: https://pkg.go.dev/sync#OnceFunc
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]