From a79bdbbe47ec32501946a35e960b1313e311aba9 Mon Sep 17 00:00:00 2001 From: acud <12988138+acud@users.noreply.github.com> Date: Wed, 7 Aug 2024 20:04:25 +0000 Subject: [PATCH] test(hare): add cleanup (#6227) ## Motivation Adds a missing cleanup to drain goroutines on test completion. --- hare4/hare_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hare4/hare_test.go b/hare4/hare_test.go index 498a80d23f..31707ac31d 100644 --- a/hare4/hare_test.go +++ b/hare4/hare_test.go @@ -598,12 +598,15 @@ func (cl *lockstepCluster) waitStopped() { // drainInteractiveMessages will make sure that the channels that signal // that interactive messages came in on the tracer are read from. func (cl *lockstepCluster) drainInteractiveMessages() { + done := make(chan struct{}) + cl.t.Cleanup(func() { close(done) }) for _, n := range cl.nodes { go func() { for { select { case <-n.tracer.compactReq: case <-n.tracer.compactResp: + case <-done: } } }()