diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-03-22 14:50:39 +0100 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2022-03-30 15:36:05 -0400 |
commit | 89a4466ee8944df5976a62e50ef67ba0beef033d (patch) | |
tree | e2aece5bf850f2143178e4977e609c9081784912 | |
parent | 4dbb2bf92b2b0a85e5506375267e8a3ccf937bc8 (diff) | |
download | podman-89a4466ee8944df5976a62e50ef67ba0beef033d.tar.gz podman-89a4466ee8944df5976a62e50ef67ba0beef033d.tar.bz2 podman-89a4466ee8944df5976a62e50ef67ba0beef033d.zip |
fix compose test error in retry logic
We cannot use local var outside of a function. We have to use a global
one.
Log: https://storage.googleapis.com/cirrus-ci-6707778565701632-fcae48/artifacts/containers/podman/5970023511490560/html/compose_v2-podman-fedora-35-root-host.log.html
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
-rw-r--r-- | test/compose/slirp4netns_opts/tests.sh | 9 |
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" |