#!/bin/bash TMP=${TMPDIR:-/tmp} wget "https://buildfarm.postgresql.org/cgi-bin/show_failures.pl" -O "$TMP/failures.html" wget "https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures" -O "$TMP/known-test-failures.html" sed -E 's/\&max_days/\&max_days/; s/(hours|mins|secs| i) < /\1 \< /' -i "$TMP/failures.html" cat << 'EOF' > "$TMP/t.xsl" EOF for fl in $(xsltproc "$TMP/t.xsl" "$TMP/failures.html"); do if [[ $fl == show_log* ]]; then sfl=${fl/\&/\&} grep -q "$sfl" "$TMP/known-test-failures.html" && continue echo "An unknown failure found: https://buildfarm.postgresql.org/cgi-bin/$fl" wget "https://buildfarm.postgresql.org/cgi-bin/$fl" -O "$TMP/failure-$fl.log" il="" if grep -q -Pzo \ '(?s)pgsql.build/testrun/pg_basebackup/040_pg_createsubscriber/log/regress_log_040_pg_createsubscriber\b.*'\ 'ok 29 - run pg_createsubscriber without --databases\s*\n.*'\ 'pg_createsubscriber: error: recovery timed out\s*\n.*'\ 'not ok 30 - run pg_createsubscriber on node S\s*\n'\ "$TMP/failure-$fl.log"; then il="https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#040_pg_createsubscriber.pl_fails_due_to_recovery_timed_out_during_pg_createsubscriber_run" elif grep -q -Pzo '(?s)(pgsql.build/testrun/postgres_fdw-running/regress|pgsql.build/testrun/postgres_fdw/regress|pgsql.build/contrib/postgres_fdw)/regression.diffs<.*'\ ' ERROR: canceling statement due to statement timeout\s*\n'\ '\+WARNING: could not get result of cancel request due to timeout\s*\n'\ "$TMP/failure-$fl.log"; then il="https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#The_postgres_fdw_test_fails_due_to_an_unexpected_warning_on_canceling_a_statement" elif grep -q -Pzo \ '(?s)# poll_query_until timed out executing this query:\s*\n'\ '# \s*\n'\ '# SELECT NOT EXISTS \(\s*\n'\ '# SELECT \*\s*\n'\ '# FROM pg_database\s*\n'\ "#\s*WHERE age\(datfrozenxid\) \> current_setting\('autovacuum_freeze_max_age'\)::int\)\s*\n.*"\ '# Looks like your test exited with 29 just after 1.\s*\n'\ 't/001_emergency_vacuum.pl ..\s*\n'\ "$TMP/failure-$fl.log"; then il="https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#001_emergency_vacuum.pl_fails_to_wait_for_datfrozenxid_advancing" elif grep -q -Pzo \ '(?s)Details for system "[^"]+" failure at stage pg_amcheckCheck,.*'\ 'postgresql:pg_amcheck / pg_amcheck/005_opclass_damage\s+TIMEOUT'\ "$TMP/failure-$fl.log"; then il="https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#005_opclass_damage.pl_fails_on_Windows_animals_due_to_timeout" elif grep -q -Pzo \ '(?s)pgsql.build/src/test/isolation/output_iso/regression.diffs<.*'\ '\+isolationtester: canceling step d2a1 after (300|360) seconds\s*\n'\ ' step d2a1: <... completed>\s*\n'\ '- sum\s*\n'\ '------\s*\n'\ '-10000\s*\n.*'\ '\+ERROR: canceling statement due to user request\s*\n'\ ' step e1c: COMMIT;'\ "$TMP/failure-$fl.log"; then il="https://wiki.postgresql.org/wiki/Known_Buildfarm_Test_Failures#deadlock-parallel.spec_fails_due_to_timeout_on_jit-enabled_animals" fi if [ -n "$il" ]; then echo " The corresponding issue: $il" echo fi else echo "Invalid link: $fl" fi done