Distinguish timeout from real TURN test failure, bump timeout to 20s
Latest live run showed the test getting killed by its own `timeout 10` before turnutils_uclient printed any result — just two startup INFO lines, no error. That's the coturn/coturn Docker image's turnutils_uclient (apparently a newer build with structured "LEVEL component: message" logging, different from the older packaged version available for local testing) taking longer than 10s to complete, not a real failure. Bumped both scripts' timeout to 20s, and now check for timeout(1)'s own exit code (124) separately from a real reported error — reported as WARN with a suggested manual command to re-run with more time and see the full result, instead of lumping "still running" in with "actually failed." Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4k6J1qXXyYxhGEgnJaMvn
This commit is contained in:
@@ -179,10 +179,16 @@ else
|
||||
# confirmed correctly reporting success (exit 0, real packet-loss
|
||||
# stats) with valid credentials and failure ("Cannot complete
|
||||
# Allocation", exit 255) with a wrong password.
|
||||
OUT="$(docker exec coturn timeout 10 turnutils_uclient -u "$_u" -w "$_p" -y "$TEST_HOST" -p "$COTURN_PORT" 2>&1)"
|
||||
OUT="$(docker exec coturn timeout 20 turnutils_uclient -u "$_u" -w "$_p" -y "$TEST_HOST" -p "$COTURN_PORT" 2>&1)"
|
||||
RC=$?
|
||||
if [ "$RC" -eq 0 ]; then
|
||||
ok "$c: TURN allocation succeeded (credentials + relay range + reachability all confirmed working)"
|
||||
elif [ "$RC" -eq 124 ]; then
|
||||
# timeout(1)'s own exit code — no error was printed yet when the
|
||||
# clock ran out, so this isn't a reported failure like "Cannot
|
||||
# complete Allocation" would be. Worth a look, not a hard FAIL.
|
||||
warn "$c: TURN test didn't finish within 20s (no error printed — likely still negotiating). Raw output so far:"
|
||||
echo "$OUT" | tail -n 15 | sed 's/^/ /'
|
||||
else
|
||||
fail "$c: TURN allocation failed (exit $RC) — raw output:"
|
||||
echo "$OUT" | tail -n 15 | sed 's/^/ /'
|
||||
|
||||
@@ -232,9 +232,19 @@ else
|
||||
# packet-loss stats) with valid credentials and correctly fails
|
||||
# ("Cannot complete Allocation", exit 255) with a wrong password —
|
||||
# a real pass/fail signal, not just "didn't crash."
|
||||
OUT="$(docker exec "$COTURN_CONTAINER" timeout 10 turnutils_uclient -u "$TURN_USERNAME" -w "$TURN_PASSWORD" -y 127.0.0.1 -p "${TURN_PORT:-3478}" 2>&1)"
|
||||
if [ $? -eq 0 ]; then
|
||||
OUT="$(docker exec "$COTURN_CONTAINER" timeout 20 turnutils_uclient -u "$TURN_USERNAME" -w "$TURN_PASSWORD" -y 127.0.0.1 -p "${TURN_PORT:-3478}" 2>&1)"
|
||||
RC=$?
|
||||
if [ "$RC" -eq 0 ]; then
|
||||
ok "Live TURN allocation succeeded with Asterisk's own configured credentials (user '$TURN_USERNAME')"
|
||||
elif [ "$RC" -eq 124 ]; then
|
||||
# timeout(1)'s own exit code — the process was still running
|
||||
# (no error printed yet) when the clock ran out, not a reported
|
||||
# failure. Different from an actual auth/allocation error, so
|
||||
# don't conflate the two — a real error prints its own message
|
||||
# (e.g. "Cannot complete Allocation") well before this.
|
||||
warn "TURN test with Asterisk's credentials didn't finish within 20s (no error printed — likely still negotiating). Raw output so far:"
|
||||
echo "$OUT" | tail -n 15 | sed 's/^/ /'
|
||||
warn "Try running manually with more time: docker exec $COTURN_CONTAINER turnutils_uclient -u $TURN_USERNAME -w $TURN_PASSWORD -y 127.0.0.1 -p ${TURN_PORT:-3478}"
|
||||
else
|
||||
fail "Live TURN allocation FAILED with Asterisk's configured credentials — raw output:"
|
||||
echo "$OUT" | tail -n 15 | sed 's/^/ /'
|
||||
|
||||
Reference in New Issue
Block a user