Files
podman/cmd
Paul Holzinger 1ecbae1b5f fix broken kube play --wait behavior
There is a race condition in the signal handling which manifests itself
as flake in our CI.
In short the old code was running the signal handler in a goroutine but
never waited for it to be finished the main routine just waits for the
container exit so it was possible the process exits in PlayKubeDown()
between the PodStop and PodRm calls. So the container/pod was leaked and
thus the test fails.
This can be easily reproduced by adding a sleep there.

To fix this properly we use a wait group to ensure the goroutine is
finished before we exit. Then there is also no need for the extra bool
and teardown on the non signal path. We can just close the channel there
and cleanup via the signal goroutine which will always fire when the
channel is closed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-07-14 14:50:55 +02:00
..