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 <mgozdekof@gmail.com>
This commit is contained in:
Mateusz Gozdek 2021-11-10 10:43:50 +01:00 committed by Julien Pivotto
parent ed698c5480
commit 7bd7573891

View file

@ -34,8 +34,7 @@ func TestStartupInterrupt(t *testing.T) {
prom := exec.Command(promPath, "-test.main", "--config.file="+promConfig, "--storage.tsdb.path="+t.TempDir()) prom := exec.Command(promPath, "-test.main", "--config.file="+promConfig, "--storage.tsdb.path="+t.TempDir())
err := prom.Start() err := prom.Start()
if err != nil { if err != nil {
t.Errorf("execution error: %v", err) t.Fatalf("execution error: %v", err)
return
} }
done := make(chan error, 1) done := make(chan error, 1)
@ -64,8 +63,7 @@ Loop:
} }
if !startedOk { if !startedOk {
t.Errorf("prometheus didn't start in the specified timeout") t.Fatal("prometheus didn't start in the specified timeout")
return
} }
if err := prom.Process.Kill(); err == nil { if err := prom.Process.Kill(); err == nil {
t.Errorf("prometheus didn't shutdown gracefully after sending the Interrupt signal") t.Errorf("prometheus didn't shutdown gracefully after sending the Interrupt signal")