Skip to content

Commit

Permalink
system tests: fix racey sdnotify test
Browse files Browse the repository at this point in the history
Race introduced in containers#16709, which changed 'top' to 'true', so
there was only a narrow window in which '.State.ConmonPod'
would be valid. Remove the race.

Fixes: containers#17882

Signed-off-by: Ed Santiago <santiago@redhat.com>
  • Loading branch information
edsantiago committed Mar 27, 2023
1 parent 78f1ebb commit 92e0efc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/system/260-sdnotify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ spec:
restartPolicy: "Never"
containers:
- command:
- true
- /bin/sh
- -c
- 'while :; do if test -e /tearsinrain; then exit 0; fi; sleep 1; done'
image: $IMAGE
name: test
resources: {}
Expand All @@ -225,7 +227,8 @@ EOF
run_podman container inspect $service_container --format "{{.State.ConmonPid}}"
main_pid="$output"

# Will run until all containers have stopped.
# Tell pod to finish, then wait for all containers to stop
run_podman exec test_pod-test touch /tearsinrain
run_podman container wait $service_container test_pod-test

# Make sure the containers have the correct policy.
Expand Down

0 comments on commit 92e0efc

Please sign in to comment.