mirror of
https://github.com/containers/podman.git
synced 2025-06-28 14:29:04 +08:00
fix compose test flake
Reading from the nc socket is flaky because docker-compose only starts the containers. We cannot know at this point if the container did already send the message. Give the container 5 seconds time to send the message to prevent flakes. This happened rarely with compose v1 but it looks like it will happen a lot more with compose v2. Example failure log: https://storage.googleapis.com/cirrus-ci-6707778565701632-fcae48/artifacts/containers/podman/6567556239589376/html/compose_v2-podman-fedora-35-rootless-host.log.html Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -3,4 +3,18 @@
|
|||||||
output="$(cat $OUTFILE)"
|
output="$(cat $OUTFILE)"
|
||||||
expected="teststring"
|
expected="teststring"
|
||||||
|
|
||||||
|
# Reading from the nc socket is flaky because docker-compose only starts
|
||||||
|
# the containers. We cannot know at this point if the container did already
|
||||||
|
# send the message. Give the container 5 seconds time to send the message
|
||||||
|
# to prevent flakes.
|
||||||
|
local _timeout=5
|
||||||
|
while [ $_timeout -gt 0 ]; do
|
||||||
|
if [ -n "$output" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
_timeout=$(($_timeout - 1))
|
||||||
|
output="$(cat $OUTFILE)"
|
||||||
|
done
|
||||||
|
|
||||||
is "$output" "$expected" "$testname : nc received teststring"
|
is "$output" "$expected" "$testname : nc received teststring"
|
||||||
|
Reference in New Issue
Block a user