summaryrefslogtreecommitdiff
path: root/test/compose/slirp4netns_opts/tests.sh
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-19 11:26:40 +0100
committerGitHub <noreply@github.com>2022-03-19 11:26:40 +0100
commit0248ba48974efd7cce0b89254b6e36d3d73b43ec (patch)
tree1b0013d4dd1585f487b810ebe5e87d809024ff6c /test/compose/slirp4netns_opts/tests.sh
parentc2eae35c606382418c6e2ce57c4ab874f1975f21 (diff)
parent54641f5f761dff9f2392548f275e41953352796e (diff)
downloadpodman-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/compose/slirp4netns_opts/tests.sh')
-rw-r--r--test/compose/slirp4netns_opts/tests.sh14
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"