#!/bin/bash TMP=${TMPDIR:-/tmp} wget "https://buildfarm.postgresql.org/cgi-bin/show_failures.pl?max_days=31" -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 \< /; s/\ / /g' -i "$TMP/failures.html" cat << 'EOF' > "$TMP/t.xsl" EOF for fl in $(xsltproc "$TMP/t.xsl" "$TMP/failures.html"); do #echo $fl 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)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