mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-29 03:35:09 +01:00
Add additional error checking for server startup
This commit is contained in:
parent
30b5478104
commit
b928ff642f
@ -271,6 +271,10 @@ func RunTestServer() func() {
|
||||
go func() {
|
||||
_ = cmd.Wait()
|
||||
}()
|
||||
expectedSuffix := "Listening on :8080\n"
|
||||
if !strings.HasSuffix(stdout.String(), expectedSuffix) {
|
||||
panic(fmt.Errorf("expected server stdout to end with %#v, but it doesn't: %#v", expectedSuffix, stdout.String()))
|
||||
}
|
||||
return func() {
|
||||
err := cmd.Process.Kill()
|
||||
if err != nil && err.Error() != "os: process already finished" {
|
||||
|
Loading…
Reference in New Issue
Block a user