Skip to content

Commit

Permalink
e2e tests: fix restart race
Browse files Browse the repository at this point in the history
It's so easy to forget that "podman start" is nonblocking.
So podman create, start, restart has a race where "restart"
can run before the container actually starts.

Solution: start --attach. Thanks to @vrothberg for noticing that.

There are still a handful of other suspicious-looking restarts
in this test, but all involve "top" which of course has to be
detached. Since those don't have any flakes that I know of, I
choose to ignore them.

Fixes: containers#16505

Signed-off-by: Ed Santiago <[email protected]>
  • Loading branch information
edsantiago committed Nov 15, 2022
1 parent 6c37cf3 commit 58869dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/e2e/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var _ = Describe("Podman restart", func() {
startTime := podmanTest.Podman([]string{"inspect", "--format='{{.State.StartedAt}}'", cid})
startTime.WaitWithDefaultTimeout()

startSession := podmanTest.Podman([]string{"start", cid})
startSession := podmanTest.Podman([]string{"start", "--attach", cid})
startSession.WaitWithDefaultTimeout()
Expect(startSession).Should(Exit(0))

Expand Down

0 comments on commit 58869dc

Please sign in to comment.