summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-03-22 19:36:28 +0100
committerGitHub <noreply@github.com>2022-03-22 19:36:28 +0100
commitc840f64e419813f389d88e16294ce916aaf31957 (patch)
tree257ac288668f1566b32e69f774f61b6411d6a197 /test
parent5cb827ff178e0c85fd99f06642a5d676833839a2 (diff)
parentc25213c8f8d23d82768b53d23909cdbf9f9235ea (diff)
downloadpodman-c840f64e419813f389d88e16294ce916aaf31957.tar.gz
podman-c840f64e419813f389d88e16294ce916aaf31957.tar.bz2
podman-c840f64e419813f389d88e16294ce916aaf31957.zip
Merge pull request #13593 from Luap99/compose-flakev2
fix compose test error in retry logic
Diffstat (limited to 'test')
-rw-r--r--test/compose/slirp4netns_opts/tests.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/compose/slirp4netns_opts/tests.sh b/test/compose/slirp4netns_opts/tests.sh
index cfa84e1e4..2d41311ad 100644
--- a/test/compose/slirp4netns_opts/tests.sh
+++ b/test/compose/slirp4netns_opts/tests.sh
@@ -1,20 +1,19 @@
# -*- bash -*-
-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
+container_timeout=5
+while [ $container_timeout -gt 0 ]; do
+ output="$(< $OUTFILE)"
if [ -n "$output" ]; then
break
fi
sleep 1
- _timeout=$(($_timeout - 1))
- output="$(cat $OUTFILE)"
+ container_timeout=$(($container_timeout - 1))
done
is "$output" "$expected" "$testname : nc received teststring"