diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-03-19 11:26:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 11:26:40 +0100 |
commit | 0248ba48974efd7cce0b89254b6e36d3d73b43ec (patch) | |
tree | 1b0013d4dd1585f487b810ebe5e87d809024ff6c /test | |
parent | c2eae35c606382418c6e2ce57c4ab874f1975f21 (diff) | |
parent | 54641f5f761dff9f2392548f275e41953352796e (diff) | |
download | podman-0248ba48974efd7cce0b89254b6e36d3d73b43ec.tar.gz podman-0248ba48974efd7cce0b89254b6e36d3d73b43ec.tar.bz2 podman-0248ba48974efd7cce0b89254b6e36d3d73b43ec.zip |
Merge pull request #13558 from Luap99/compose-flake
fix compose test flake
Diffstat (limited to 'test')
-rw-r--r-- | test/compose/slirp4netns_opts/tests.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/compose/slirp4netns_opts/tests.sh b/test/compose/slirp4netns_opts/tests.sh index 1efce45c4..cfa84e1e4 100644 --- a/test/compose/slirp4netns_opts/tests.sh +++ b/test/compose/slirp4netns_opts/tests.sh @@ -3,4 +3,18 @@ output="$(cat $OUTFILE)" 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" |