You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(audience): replace fixed timeout with log-driven watchdog (SDK-317)
- Drops the `timeout 1320` wrapper. Replaces it with a watchdog loop
inside the docker bash that polls artifacts/playmode.log every 5 s
and signals Unity 30 s after "Test run completed" first appears.
- 40 min hard cap as a fallback for the case where Unity never logs
"Test run completed" (player hang, etc.); 15 s SIGKILL grace after
SIGTERM if the editor refuses to exit.
- Bumps cell timeout-minutes from 30 to 45 to cover the inner 40 min
cap plus post-Unity steps (license return, Player.log copy, artifact
upload, dorny/test-reporter).
- Why: a fixed timeout that fits Unity 2021.3 (~5-7 min cells) cuts
Unity 6 off mid-run; a fixed timeout sized for Unity 6 makes 2021.3
cells wait up to 30+ min on a shutdown hang they would not have
hit. The previous 22-min cap killed Unity 6 cells before tests
could finish writing playmode-results.xml. The watchdog adapts to
whatever the actual test runtime is, then catches the Unity 6
Linux shutdown hang ("Application is shutting down..." that never
completes) without waiting on it.
- Also captures `tail -F` of the log to job stdout while Unity is
alive, so the live build / test progress streams to the GitHub
Actions log as before.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Stream the log to job stdout for live visibility while the
547
+
# editor is alive. tail --pid exits when unity_pid does.
548
+
tail --pid=$unity_pid -F "$log" 2>/dev/null &
549
+
550
+
deadline=$((SECONDS + 2400)) # 40 min hard cap
551
+
flush_deadline=0
552
+
kill_reason=""
553
+
while kill -0 $unity_pid 2>/dev/null; do
554
+
if [ "$SECONDS" -ge "$deadline" ]; then
555
+
kill_reason="hard-cap-40m"
556
+
break
557
+
fi
558
+
if [ "$flush_deadline" -eq 0 ] && grep -q "Test run completed" "$log" 2>/dev/null; then
559
+
flush_deadline=$((SECONDS + 30))
560
+
echo "[watchdog] saw \"Test run completed\" at ${SECONDS}s; SIGTERM after 30s flush window"
561
+
fi
562
+
if [ "$flush_deadline" -gt 0 ] && [ "$SECONDS" -ge "$flush_deadline" ]; then
563
+
kill_reason="flush-window-elapsed"
564
+
break
565
+
fi
566
+
sleep 5
567
+
done
568
+
569
+
if [ -n "$kill_reason" ]; then
570
+
echo "[watchdog] sending SIGTERM to Unity (reason: $kill_reason)"
571
+
kill -TERM $unity_pid 2>/dev/null || true
572
+
# 15 s grace, then SIGKILL if still alive.
573
+
for _ in 1 2 3; do
574
+
kill -0 $unity_pid 2>/dev/null || break
575
+
sleep 5
576
+
done
577
+
if kill -0 $unity_pid 2>/dev/null; then
578
+
echo "[watchdog] SIGTERM not honored, sending SIGKILL"
579
+
kill -KILL $unity_pid 2>/dev/null || true
580
+
fi
581
+
fi
582
+
583
+
wait $unity_pid 2>/dev/null
584
+
test_rc=$?
585
+
if [ "$kill_reason" = "hard-cap-40m" ]; then
586
+
echo "::warning::Unity hit the 40 min hard cap without logging \"Test run completed\". The player may have hung mid-suite. Inspect Player.log to see how far it got."
544
587
fi
545
588
546
589
# Capture the standalone test player log. PlayMode tests on
0 commit comments