diff options
author | Chris Evich <cevich@redhat.com> | 2021-07-19 10:55:33 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2021-07-19 15:36:13 -0400 |
commit | 80e807a1913411b6829a41ef47de285b38e27b66 (patch) | |
tree | b38a1e7da5cce72e1744878266160c6bf025109b /pkg | |
parent | c17633c6a47799d8a13988b07dd580d28a669c90 (diff) | |
download | podman-80e807a1913411b6829a41ef47de285b38e27b66.tar.gz podman-80e807a1913411b6829a41ef47de285b38e27b66.tar.bz2 podman-80e807a1913411b6829a41ef47de285b38e27b66.zip |
Flake Fix: Wait before connecting container port
It was observed during periodic testing, this test can fail due to the
container process being not fully running and listening on the expected
port:
```
[+1069s] not ok 220 podman networking: port with --userns=keep-id
[+1069s] # (in test file test/system/500-networking.bats, line 144)
[+1069s] # `echo "$teststring" | nc 127.0.0.1 $myport' failed
[+1069s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman rm
--all --force
[+1069s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman ps
--all --external --format {{.ID}} {{.Names}}
[+1069s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman
images --all --format {{.Repository}}:{{.Tag}} {{.ID}}
[+1069s] # quay.io/libpod/testimage:20210610 9f9ec7f2fdef
[+1069s] # # /var/tmp/go/src/github.com/containers/podman/bin/podman run
-d --userns=keep-id -p 127.0.0.1:54322:54322
quay.io/libpod/testimage:20210610 nc -l -n -v -p 54322
[+1069s] #
252c562c9a3c96892d867d1d72fb52b2efdfe62855ebedbccd2d281c472c2988
[+1069s] # Ncat: No route to host.
```
Fix this by using a new `wait_for_port()` function (thanks @edsantiago)
before attempting to communicate with the service.
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'pkg')
0 files changed, 0 insertions, 0 deletions