From 6af9be8d566b955ded6f9e08a4d1691841e2fca8 Mon Sep 17 00:00:00 2001 From: Kamil Jezek Date: Tue, 10 Sep 2024 16:27:09 +0200 Subject: [PATCH] drain potential remaining signals --- go/database/mpt/node_flusher_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/go/database/mpt/node_flusher_test.go b/go/database/mpt/node_flusher_test.go index 512a93d3d..21aea5a65 100644 --- a/go/database/mpt/node_flusher_test.go +++ b/go/database/mpt/node_flusher_test.go @@ -81,6 +81,15 @@ func TestNodeFlusher_TriggersFlushesPeriodically(t *testing.T) { if err := flusher.Stop(); err != nil { t.Fatalf("failed to stop node flusher: %v", err) } + + // drain potential remaining signals + for { + select { + case <-flushSignal: + default: + return + } + } } func TestNodeFlusher_ErrorsAreCollected(t *testing.T) {