mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
Merge pull request #13593 from Luap99/compose-flakev2
fix compose test error in retry logic
This commit is contained in:
@ -1,20 +1,19 @@
|
|||||||
# -*- bash -*-
|
# -*- bash -*-
|
||||||
|
|
||||||
output="$(cat $OUTFILE)"
|
|
||||||
expected="teststring"
|
expected="teststring"
|
||||||
|
|
||||||
# Reading from the nc socket is flaky because docker-compose only starts
|
# 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
|
# 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
|
# send the message. Give the container 5 seconds time to send the message
|
||||||
# to prevent flakes.
|
# to prevent flakes.
|
||||||
local _timeout=5
|
container_timeout=5
|
||||||
while [ $_timeout -gt 0 ]; do
|
while [ $container_timeout -gt 0 ]; do
|
||||||
|
output="$(< $OUTFILE)"
|
||||||
if [ -n "$output" ]; then
|
if [ -n "$output" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
_timeout=$(($_timeout - 1))
|
container_timeout=$(($container_timeout - 1))
|
||||||
output="$(cat $OUTFILE)"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
is "$output" "$expected" "$testname : nc received teststring"
|
is "$output" "$expected" "$testname : nc received teststring"
|
||||||
|
Reference in New Issue
Block a user