From 58869dcc3076e2b5b403cf2faaabde45e817d8e1 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 15 Nov 2022 07:44:52 -0700 Subject: [PATCH] e2e tests: fix restart race 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: #16505 Signed-off-by: Ed Santiago --- test/e2e/restart_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/restart_test.go b/test/e2e/restart_test.go index effb716a8e..f650517f16 100644 --- a/test/e2e/restart_test.go +++ b/test/e2e/restart_test.go @@ -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))