commit 01a2db3aa7d2e31344fe26705df58849646320ab parent 1ff51f2de5dea26ecd3b1fbf8bd1b30ec464fe85 Author: Christian Grothoff <christian@grothoff.org> Date: Tue, 28 Jul 2026 17:23:20 +0200 make test setup more robust Diffstat:
| M | src/testing/setup.sh | | | 28 | +++++++++++++++++++++++++++- |
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/testing/setup.sh b/src/testing/setup.sh @@ -43,9 +43,35 @@ function setup() SETUP_PID=$! # Close FD3 exec 3>&- - sed -u '/READY:/ q' <&4 + # Wait for the 'READY:' line. Reading until EOF instead of using + # 'sed -u /READY:/ q' lets us tell "the system came up" apart from + # "taler-unified-setup.sh died first": on EOF without READY the test + # would otherwise carry on against services that are not running and + # fail much later with a confusing error. + READY=0 + while IFS= read -r LINE <&4 + do + printf '%s\n' "$LINE" + case "$LINE" in + READY:*) + READY=1 + break + ;; + esac + done # Close FD4 exec 4>&- + if [ "$READY" != "1" ] + then + SETUP_STATUS=0 + wait "$SETUP_PID" || SETUP_STATUS=$? + unset SETUP_PID + if [ "$SETUP_STATUS" = "77" ] + then + exit_skip "taler-unified-setup.sh could not launch the test system" + fi + exit_fail "taler-unified-setup.sh died with status $SETUP_STATUS before the test system was ready" + fi echo "Test system ready" >&2 }