Skip to content

Commit ff7e7d7

Browse files
authored
ci(bigquery): keep diagnostics when the runner hangs (#6246)
Signed-off-by: mday-io <mdaytn@gmail.com>
1 parent 9e854d9 commit ff7e7d7

1 file changed

Lines changed: 31 additions & 13 deletions

File tree

‎.github/workflows/pr.yaml‎

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -436,24 +436,42 @@ jobs:
436436
"$TEST_DB_NAME" up
437437
- name: Run tests
438438
env:
439-
# Temporary BigQuery diagnostics: since 2026-10-31 the runner is shut down
440-
# ~1 minute into pytest with no test output. Stream test results and log
441-
# memory/disk so the next failure shows what was running. Remove once fixed.
439+
# Temporary BigQuery diagnostics: since 2026-10-31 the BigQuery runner either shuts
440+
# down or stops responding mid-pytest, and its log is never uploaded. Keep the
441+
# evidence in files, stop pytest before the job limit so the runner can recover,
442+
# and upload the files in the steps below. Remove once fixed.
442443
PYTHONUNBUFFERED: ${{ matrix.engine == 'bigquery' && '1' || '' }}
443444
PYTEST_ADDOPTS: ${{ matrix.engine == 'bigquery' && '-v' || '' }}
444445
run: |
445446
source .venv/bin/activate
446-
if [ "${{ matrix.engine }}" = "bigquery" ]; then
447-
(
448-
while true; do
449-
echo "[resources $(date -u +%T)] $(free -m | awk '/Mem:/{print "mem_used="$3"MB mem_avail="$7"MB"}') $(free -m | awk '/Swap:/{print "swap_used="$3"MB"}') $(df -h / | awk 'NR==2{print "disk_used="$5}')"
450-
ps -eo rss=,args= --sort=-rss | head -4 | awk '{rss=$1; $1=""; printf " rss=%dMB %.120s\n", rss/1024, $0}'
451-
sleep 5
452-
done
453-
) &
454-
trap "kill $! 2>/dev/null || true" EXIT
447+
if [ "${{ matrix.engine }}" != "bigquery" ]; then
448+
make ${{ matrix.engine }}-test
449+
exit
455450
fi
456-
make ${{ matrix.engine }}-test
451+
mkdir -p test-results
452+
(
453+
while true; do
454+
echo "[resources $(date -u +%T)] $(free -m | awk '/Mem:/{print "mem_used="$3"MB mem_avail="$7"MB"}') $(free -m | awk '/Swap:/{print "swap_used="$3"MB"}') $(df -h / | awk 'NR==2{print "disk_used="$5}')"
455+
ps -eo rss=,args= --sort=-rss | head -4 | awk '{rss=$1; $1=""; printf " rss=%dMB %.120s\n", rss/1024, $0}'
456+
sleep 5
457+
done
458+
) >> test-results/bigquery-resources.log 2>&1 &
459+
trap "kill $! 2>/dev/null || true" EXIT
460+
make engine-bigquery-install
461+
uv pip install -e ".[bigframes]"
462+
# Same commands as the Makefile's bigquery-test target, under a timeout so
463+
# pytest itself (not just make) is stopped before the 25 minute job limit.
464+
set -o pipefail
465+
timeout --kill-after=60s 18m pytest -n auto -m "bigquery" --reruns 3 \
466+
--junitxml=test-results/junit-bigquery.xml 2>&1 | tee test-results/bigquery-pytest.log
467+
- name: Collect BigQuery diagnostics
468+
if: ${{ always() && matrix.engine == 'bigquery' }}
469+
run: |
470+
mkdir -p test-results
471+
sudo dmesg -T | grep -iE 'out of memory|oom|killed process' > test-results/bigquery-dmesg.log || true
472+
echo "== kernel OOM messages"; cat test-results/bigquery-dmesg.log
473+
echo "== last resource samples"; tail -n 60 test-results/bigquery-resources.log || true
474+
echo "== last pytest output"; tail -n 60 test-results/bigquery-pytest.log || true
457475
- name: Tear down test database
458476
if: always()
459477
run:

0 commit comments

Comments
 (0)