container wait: improve error message
Improve the error message when looking up the exit code of a container.
The state of the container may help us track down which flakes
rarely and is impossible to reproduce on my machine.
[NO NEW TESTS NEEDED]
@@ -555,7 +555,7 @@ func (c *Container) WaitForExit(ctx context.Context, pollInterval time.Duration)
// The container never ran.
return true, 0, nil
}
- return true, -1, err
+ return true, -1, fmt.Errorf("%w (container in state %s)", err, c.state.State)
}
return true, exitCode, nil
