Skip to content

Commit

Permalink
notify k8s system test: move sending message into exec
Browse files Browse the repository at this point in the history
The flake in containers#16076 is likely related to the notify message not being
delivered/read correctly.  Move sending the message into an exec session
such that flakes will reveal an error message.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Dec 5, 2022
1 parent f223bba commit 8c3af71
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/system/260-sdnotify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ metadata:
labels:
app: test
name: test_pod
restartPolicy: "Never"
annotations:
io.containers.sdnotify: "container"
io.containers.sdnotify/b: "conmon"
Expand All @@ -276,7 +277,7 @@ spec:
- command:
- /bin/sh
- -c
- 'printenv NOTIFY_SOCKET; echo READY; while ! test -f /stop;do sleep 0.1;done;systemd-notify --ready'
- 'printenv NOTIFY_SOCKET; while ! test -f /stop;do sleep 0.1;done'
image: $_FEDORA
name: a
- command:
Expand Down Expand Up @@ -332,13 +333,17 @@ ignore"
run_podman logs $container_a
is "${lines[0]}" "/run/notify/notify.sock" "NOTIFY_SOCKET is passed to container"

run_podman exec --env NOTIFY_SOCKET="/run/notify/notify.sock" $container_a /usr/bin/systemd-notify --ready

# Instruct the container to send the READY
run_podman exec $container_a /bin/touch /stop

run_podman container inspect $service_container --format "{{.State.ConmonPid}}"
main_pid="$output"

run_podman container wait $container_a
run_podman container inspect $container_a --format "{{.State.ExitCode}}"
is "$output" "0" "container exited cleanly after sending READY message"
wait_for_file $_SOCAT_LOG
# The 'echo's help us debug failed runs
run cat $_SOCAT_LOG
Expand Down

0 comments on commit 8c3af71

Please sign in to comment.