From 223c937a20b123637db5d7dfa7cf2d2b49915431 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Mon, 10 Aug 2026 15:56:31 -0700 Subject: [PATCH] test(e2e-ui): print the proxy log when the proxy dies on its own In E2E_KEEP_ALIVE=1 mode the harness blocks until the proxy pid goes away, then printed a bare "Proxy exited." and fell straight into cleanup, which rm -f's the log. The proxy has now exited by itself twice, minutes after a run had finished, leaving nothing to look at. Both startup failure paths already tail -n 100 the log before giving up, so this was the one death that stayed silent Dump the same 100 lines before exiting. A normal Ctrl-C teardown still deletes the log and prints nothing, which is why INT and TERM now exit instead of running cleanup and falling back into the wait loop: under the single trap a SIGTERM deleted the log, resumed the loop, and would then report "tail: no such file", besides running cleanup twice --- tests/e2e/ui/run_e2e.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/e2e/ui/run_e2e.sh b/tests/e2e/ui/run_e2e.sh index f9341b2602c..67e3225f668 100755 --- a/tests/e2e/ui/run_e2e.sh +++ b/tests/e2e/ui/run_e2e.sh @@ -89,7 +89,11 @@ cleanup() { fi echo "Done." } -trap cleanup EXIT INT TERM +on_signal() { + exit 130 +} +trap cleanup EXIT +trap on_signal INT TERM # --- Pre-flight checks --- for cmd in python3 npx uv; do @@ -271,7 +275,8 @@ EOF while kill -0 "$PROXY_PID" 2>/dev/null; do sleep 5 done - echo "Proxy exited." + echo "Error: proxy process exited unexpectedly. Proxy output:" + tail -n 100 "$PROXY_LOG" exit 1 fi