mirror of
https://github.com/containers/podman.git
synced 2025-06-29 15:08:09 +08:00
fix podman system connection - tcp
flake
The test was only waiting for the port to be ready but that doesn't imply the server being ready to serve requests. Hence, add a loop waiting for the `info` call to succeed. Fixes: #16916 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -112,9 +112,17 @@ $c2[ ]\+tcp://localhost:54321[ ]\+true" \
|
|||||||
--runroot ${PODMAN_TMPDIR}/runroot \
|
--runroot ${PODMAN_TMPDIR}/runroot \
|
||||||
system service -t 99 tcp://localhost:$_SERVICE_PORT &
|
system service -t 99 tcp://localhost:$_SERVICE_PORT &
|
||||||
_SERVICE_PID=$!
|
_SERVICE_PID=$!
|
||||||
|
# Wait for the port and the podman-service to be ready.
|
||||||
wait_for_port localhost $_SERVICE_PORT
|
wait_for_port localhost $_SERVICE_PORT
|
||||||
|
local timeout=10
|
||||||
_run_podman_remote info --format '{{.Host.RemoteSocket.Path}}'
|
while [[ $timeout -gt 1 ]]; do
|
||||||
|
_run_podman_remote ? info --format '{{.Host.RemoteSocket.Path}}'
|
||||||
|
if [[ $status == 0 ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
let timeout=$timeout-1
|
||||||
|
done
|
||||||
is "$output" "tcp://localhost:$_SERVICE_PORT" \
|
is "$output" "tcp://localhost:$_SERVICE_PORT" \
|
||||||
"podman info works, and talks to the correct server"
|
"podman info works, and talks to the correct server"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user