From 33a73501d5d9e663d3641ea27fa02ef8e9e7c111 Mon Sep 17 00:00:00 2001 From: acud <12988138+acud@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:32:06 +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 498a80d23f5..31707ac31d0 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: } } }()