diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-14 18:01:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-14 18:01:51 -0400 |
commit | df6c7c2ae5fb77a557d5616f8b422c45a43fe0ff (patch) | |
tree | 6367cfa20296a0d57a32345c07228f6817c40ded | |
parent | 9f36efda372bec12abb60523b787730ffb98c3a2 (diff) | |
parent | 1cf2b3eb28959a8e2c9ccd4b0d40186c6731104d (diff) | |
download | podman-df6c7c2ae5fb77a557d5616f8b422c45a43fe0ff.tar.gz podman-df6c7c2ae5fb77a557d5616f8b422c45a43fe0ff.tar.bz2 podman-df6c7c2ae5fb77a557d5616f8b422c45a43fe0ff.zip |
Merge pull request #10031 from edsantiago/compose_test_flakes_again
compose test: ongoing efforts to diagnose flakes
-rwxr-xr-x | test/compose/test-compose | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/test/compose/test-compose b/test/compose/test-compose index abb957b43..c4c484190 100755 --- a/test/compose/test-compose +++ b/test/compose/test-compose @@ -136,8 +136,11 @@ function _show_ok() { local expect=$3 local actual=$4 printf "${red}not ok $count $testname${reset}\n" - printf "${red}# expected: %s${reset}\n" "$expect" - printf "${red}# actual: ${bold}%s${reset}\n" "$actual" + # Not all errors include actual/expect + if [[ -n "$expect" || -n "$actual" ]]; then + printf "${red}# expected: %s${reset}\n" "$expect" + printf "${red}# actual: ${bold}%s${reset}\n" "$actual" + fi echo "not ok $count $testname" >>$LOG echo " expected: $expect" >>$LOG @@ -164,20 +167,22 @@ function test_port() { local expect="$3" # what to expect from curl output # -s -S means "silent, but show errors" - local actual=$(curl --retry 3 --retry-all-errors -s -S http://127.0.0.1:$port/) + local actual + actual=$(curl --retry 3 --retry-all-errors -s -S http://127.0.0.1:$port/) local curl_rc=$? - # FIXME 2021-04-13: test is flaking, curl succeeds but returns empty result. - # Could it be that the container is not actually ready? Wait, and retry. - if [[ $curl_rc -eq 0 && -z "$actual" ]]; then - sleep 1 - echo "# Retrying curl:" - actual=$(curl --retry 3 --retry-all-errors -s -S http://127.0.0.1:$port/) - curl_rc=$? - fi - if [ $curl_rc -ne 0 ]; then - _show_ok 0 "$testname - curl failed with status $curl_rc" + _show_ok 0 "$testname - curl (port $port) failed with status $curl_rc" + # FIXME: is this useful? What else can we do to diagnose? + echo "# docker-compose logs:" + docker-compose logs + echo "# podman ps -a:" + $PODMAN_BIN --root $WORKDIR/root --runroot $WORKDIR/runroot ps -a + if type -p ss; then + echo "# ss -tulpn:" + ss -tulpn + fi + return fi case "$op" in |