From c3beca72e24cf441fe0927740a47c5df50d7f953 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Fri, 15 Oct 2021 19:56:18 +0200 Subject: [PATCH] cmd/prometheus: wait for Prometheus to shutdown in tests So temporary data directory can be successfully removed, as on Windows, directory cannot be in used while removal. Signed-off-by: Mateusz Gozdek --- cmd/prometheus/main_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/prometheus/main_test.go b/cmd/prometheus/main_test.go index e6c8fcc07..94196a986 100644 --- a/cmd/prometheus/main_test.go +++ b/cmd/prometheus/main_test.go @@ -226,6 +226,7 @@ func TestWALSegmentSizeBounds(t *testing.T) { t.Errorf("prometheus should be still running: %v", err) case <-time.After(5 * time.Second): prom.Process.Kill() + <-done } continue } @@ -268,6 +269,7 @@ func TestMaxBlockChunkSegmentSizeBounds(t *testing.T) { t.Errorf("prometheus should be still running: %v", err) case <-time.After(5 * time.Second): prom.Process.Kill() + <-done } continue } @@ -438,6 +440,7 @@ func TestModeSpecificFlags(t *testing.T) { t.Errorf("prometheus should be still running: %v", err) case <-time.After(5 * time.Second): prom.Process.Kill() + <-done } return }