From 7bd75738917f6bf484327e02a72fd2c4112dc842 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Wed, 10 Nov 2021 10:43:50 +0100 Subject: [PATCH] cmd/prometheus/main_unix_test.go: fix unix test styling * Formatting of error message is missing a space after ':'. * t.Fatalf should be used instead of t.Errorf+return. Signed-off-by: Mateusz Gozdek --- cmd/prometheus/main_unix_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/prometheus/main_unix_test.go b/cmd/prometheus/main_unix_test.go index b76ecbcb1..0e21a5d0a 100644 --- a/cmd/prometheus/main_unix_test.go +++ b/cmd/prometheus/main_unix_test.go @@ -34,8 +34,7 @@ func TestStartupInterrupt(t *testing.T) { prom := exec.Command(promPath, "-test.main", "--config.file="+promConfig, "--storage.tsdb.path="+t.TempDir()) err := prom.Start() if err != nil { - t.Errorf("execution error: %v", err) - return + t.Fatalf("execution error: %v", err) } done := make(chan error, 1) @@ -64,12 +63,11 @@ Loop: } if !startedOk { - t.Errorf("prometheus didn't start in the specified timeout") - return + t.Fatal("prometheus didn't start in the specified timeout") } if err := prom.Process.Kill(); err == nil { t.Errorf("prometheus didn't shutdown gracefully after sending the Interrupt signal") } else if stoppedErr != nil && stoppedErr.Error() != "signal: interrupt" { // TODO - find a better way to detect when the process didn't exit as expected! - t.Errorf("prometheus exited with an unexpected error:%v", stoppedErr) + t.Errorf("prometheus exited with an unexpected error: %v", stoppedErr) } }