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:
parent
ed698c5480
commit
7bd7573891
|
@ -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,12 +63,11 @@ 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")
|
||||||
} else if stoppedErr != nil && stoppedErr.Error() != "signal: interrupt" { // TODO - find a better way to detect when the process didn't exit as expected!
|
} 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue