Skip to content

Commit 3978347

Browse files
Merge pull request #18021 from edsantiago/unverbosify_sleeploop
System tests: unverbosify a flake log
2 parents 9d7633d + 99ace19 commit 3978347

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

test/system/032-sig-proxy.bats

+6-26
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,7 @@
33
load helpers
44

55
# Command to run in each of the tests.
6-
SLEEPLOOP='trap "echo BYE;exit 0" INT;echo READY;while :;do echo RUNNING;sleep 0.1;done'
7-
8-
function setup() {
9-
basic_setup
10-
11-
TESTLOG=$PODMAN_TMPDIR/container-stdout
12-
}
13-
6+
SLEEPLOOP='trap "echo BYE;exit 0" INT;echo READY;while :;do sleep 0.1;done'
147

158
# Main test code: wait for container to exist and be ready, send it a
169
# signal, wait for container to acknowledge and exit.
@@ -33,21 +26,8 @@ function _test_sigproxy() {
3326
fi
3427
done
3528

36-
# Now that container exists, wait for it to declare itself RUNNING
37-
timeout=10
38-
while :;do
39-
sleep 0.5
40-
if grep -q RUNNING $TESTLOG; then
41-
break
42-
fi
43-
timeout=$((timeout - 1))
44-
if [[ $timeout -eq 0 ]]; then
45-
run_podman ps -a
46-
echo "log from container:"
47-
cat $TESTLOG
48-
die "Timed out waiting for container $cname to start"
49-
fi
50-
done
29+
# Now that container exists, wait for it to declare itself READY
30+
wait_for_ready $cname
5131

5232
# Signal, and wait for container to exit
5333
kill -INT $kidpid
@@ -72,7 +52,7 @@ function _test_sigproxy() {
7252

7353
@test "podman sigproxy test: run" {
7454
# We're forced to use $PODMAN because run_podman cannot be backgrounded
75-
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" >$TESTLOG &
55+
$PODMAN run -i --name c_run $IMAGE sh -c "$SLEEPLOOP" &
7656
local kidpid=$!
7757

7858
_test_sigproxy c_run $kidpid
@@ -82,7 +62,7 @@ function _test_sigproxy() {
8262
run_podman create --name c_start $IMAGE sh -c "$SLEEPLOOP"
8363

8464
# See above comments regarding $PODMAN and backgrounding
85-
$PODMAN start --attach c_start >$TESTLOG &
65+
$PODMAN start --attach c_start &
8666
local kidpid=$!
8767

8868
_test_sigproxy c_start $kidpid
@@ -92,7 +72,7 @@ function _test_sigproxy() {
9272
run_podman run -d --name c_attach $IMAGE sh -c "$SLEEPLOOP"
9373

9474
# See above comments regarding $PODMAN and backgrounding
95-
$PODMAN attach c_attach >$TESTLOG &
75+
$PODMAN attach c_attach &
9676
local kidpid=$!
9777

9878
_test_sigproxy c_attach $kidpid

0 commit comments

Comments
 (0)