refactor: improve timeout handling in execution tests for better reliability
All checks were successful
Code Check - Quality and Syntax / syntax-lint (3.11) (push) Successful in 10s
Code Check - Quality and Syntax / syntax-lint (3.12) (push) Successful in 11s
Code Check - Quality and Syntax / syntax-lint (3.13) (push) Successful in 17s
Code Check - Quality and Syntax / syntax-lint (3.14) (push) Successful in 11s

This commit is contained in:
Space-Banane
2026-04-06 23:15:52 +02:00
parent 558ddea80b
commit 368cd02b6d

View File

@@ -60,8 +60,11 @@ jobs:
monitor_pid=$!
# Wait up to 5s for the process to exit (or be killed by the monitor)
timeout 5s wait $pid 2>/dev/null || true
status=$?
if timeout 5s bash -c 'while kill -0 "$1" 2>/dev/null; do sleep 0.1; done' _ "$pid"; then
status=0
else
status=$?
fi
# Stop the monitor and cleanup
kill $monitor_pid 2>/dev/null || true
@@ -95,8 +98,11 @@ jobs:
fi
# Default behavior for other files: try --version with a 5s timeout
timeout 5s python "$file" --version
status=$?
if timeout 5s python "$file" --version; then
status=0
else
status=$?
fi
# If it ran successfully, continue
if [ $status -eq 0 ]; then