Skip to content

Commit c0aa9b7

Browse files
author
Datanoise
committed
Fix: Make CI startup test more robust against set -e and timeout exit codes
1 parent 4c01d99 commit c0aa9b7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ jobs:
7979
echo "Starting TinyIce in background for 5 seconds to check for startup errors..."
8080
chmod +x "$BINARY_PATH" # Add execute permissions
8181
82-
# Run TinyIce with timeout. We want to pass if it exits 0 (graceful stop) or 124 (timeout).
82+
# Run TinyIce, preventing set -e from failing the script immediately if timeout returns 124.
83+
# We want to pass if it exits 0 (graceful stop) or 124 (timeout).
8384
# We fail if it exits with any other non-zero code.
84-
timeout 5s sh -c "$BINARY_PATH -port 8080 -config /tmp/tinyice-test-linux-${GOARCH}.json"
85-
TIMEOUT_EXIT_CODE=$?
85+
if timeout 5s sh -c "$BINARY_PATH -port 8080 -config /tmp/tinyice-test-linux-${GOARCH}.json"; then
86+
TIMEOUT_EXIT_CODE=0 # timeout succeeded, meaning inner command exited 0
87+
else
88+
TIMEOUT_EXIT_CODE=$? # timeout failed (either non-zero from inner command or 124 for timeout)
89+
fi
8690
8791
if [ $TIMEOUT_EXIT_CODE -eq 0 ]; then
8892
echo "TinyIce exited gracefully within 5 seconds. Test passed."

0 commit comments

Comments
 (0)