From a5285db425d0f5465a9733db0a44add56dd43890 Mon Sep 17 00:00:00 2001 From: Agent Date: Thu, 1 Oct 2026 17:29:15 +0000 Subject: [PATCH] ci: dump function-server log when an e2e suite fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The portable-runtime e2e job timed out on four changeset-release/main CI runs (PR #687 and predecessors) with only 'Timeout after 60000ms waiting for test_seq to increment by 200'. The same suite passes locally on both the base commit and the exact release diff, so the runner-side evidence lives in the supabase functions serve log — which run-e2e.sh keeps in a mktemp file that GitHub Actions never prints. Print the server log to stderr from run_with_functions_server when the monitored command fails, so the next CI failure carries worker errors (isolate CPU-limit shutdowns, forced sql close) instead of a bare timeout. Successful suites stay silent to avoid megabytes of noise. Extend the functions-server self-test: failing suite dumps the log, passing suite produces no stderr, exit statuses unchanged. --- scripts/functions-server.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/functions-server.sh b/scripts/functions-server.sh index c6dba99ba..e64c81a69 100755 --- a/scripts/functions-server.sh +++ b/scripts/functions-server.sh @@ -256,6 +256,10 @@ run_with_functions_server() { # run_with_functions_server [[ "$server_status" == 0 ]] && return 1 return "$server_status" fi + if [[ "$command_status" != 0 ]]; then + echo "Monitored command exited with status $command_status. Function server log:" >&2 + cat "$FUNCTIONS_SERVER_LOG" >&2 || true + fi return "$command_status" } @@ -355,8 +359,15 @@ self_test() { begin_server bash -c 'echo "Serving functions on http://127.0.0.1:9999/functions/v1/x"; exec sleep 30' expect_status "suite failure status survives" 0 wait_for_functions_server + echo 'worker failure diagnostic' >>"$FUNCTIONS_SERVER_LOG" expect_status "suite failure returns its status" 11 \ - run_with_functions_server bash -c 'exit 11' + run_with_functions_server bash -c 'exit 11' 2>"$tmp/suite-stderr" + expect_status "suite failure includes the function server log" 0 \ + grep -qx 'worker failure diagnostic' "$tmp/suite-stderr" + expect_status "successful suite returns zero" 0 \ + run_with_functions_server bash -c 'exit 0' 2>"$tmp/success-stderr" + expect_status "successful suite does not dump the function server log" 0 \ + test ! -s "$tmp/success-stderr" stop_functions_server : >"$tmp/docker-calls"