: # git reset --hard b282fa88d~1 && git clean -dfx : # git apply .../win-sock-tests-01.patch : # cp .../v2-*.patch . : # Setup an alias for python3 on Windows : # cd .\\. && mklink c:\Python3\python3.exe c:\Python3\python.exe REM or something like that cd .\\. && @echo off : # Multiply ssl tests perl -i.bak -ne "print unless /ssl_/" "src/test/meson.build" && python3 -c "for i in range(1,10+1):import os;import shutil;sd=\"src/test/ssl/\";td=f\"src/test/ssl_{i}\";shutil.rmtree(td,ignore_errors=1);shutil.copytree(sd, td);assert(os.system(f'perl -i.bak -pe \"s#( subdir.\'ssl\'.)# subdir(\'ssl_{i}\'){chr(92)}n{chr(92)}1#\" \"src/test/meson.build\"')==0);assert(os.system(f'perl -i.bak -pe \"s#\'ssl\',#\'ssl_{i}\',#\" \"{td}/meson.build\"')==0)" : # Multiply test_misc tests perl -i.bak -ne "print unless /test_misc_/" "src/test/modules/meson.build" && python3 -c "for i in range(1,10+1):import os;import shutil;pd=\"src/test/modules\";m=\"test_misc\";td=f\"{pd}/{m}_{i}\";shutil.rmtree(td,ignore_errors=1);shutil.copytree(f\"{pd}/{m}\", td);assert(os.system(f'perl -i.bak -pe \"s#(subdir.\'{m}\'.)#subdir(\'{m}_{i}\'){chr(92)}n{chr(92)}1#\" \"{pd}/meson.build\"')==0);assert(os.system(f'perl -i.bak -pe \"s#(\'name\': \'{m})#{chr(92)}1_{i}#\" \"{td}/meson.build\"')==0)" : # Multiply postgres_fdw tests perl -i.bak -ne "print unless /postgres_fdw_/" "contrib/meson.build" && python3 -c "for i in range(1,10+1):import os;import shutil;pd=\"contrib\";m=\"postgres_fdw\";td=f\"{pd}/{m}_{i}\";shutil.rmtree(td,ignore_errors=1);shutil.copytree(f\"{pd}/{m}\", td);assert(os.system(f'perl -i.bak -pe \"s#(subdir.\'{m}\'.)#subdir(\'{m}_{i}\'){chr(92)}n{chr(92)}1#\" \"{pd}/meson.build\"')==0);assert(os.system(f'perl -i.bak -pe \"s#(\'name\': \'{m})#{chr(92)}1_{i}#\" \"{td}/meson.build\"')==0)" cd .\\. && meson setup --wipe build -Dcassert=true -Db_pch=true -Dextra_lib_dirs="C:\Program Files\OpenSSL-Win64\lib" -Dextra_include_dirs="C:\Program Files\OpenSSL-Win64\include" -DPG_TEST_EXTRA="ssl" : && meson setup build -Dcassert=true -DPG_TEST_EXTRA="ssl" cd build && ninja >ninja.log && meson test --suite setup echo # echo ======================================== echo Re: BUG 15598: PostgreSQL Error Code is not reported when connection terminated due to idle-in-transaction timeout meson test test_misc/099_case_15598 : # this test fails on Windows without 6051857fc due to "psql::6: server closed the connection unexpectedly" grep -r "psql stderr:" "testrun/test_misc/099_case_15598" : # this test fails on Windows with 6051857fc due to "psql::6: could not receive data from server: Software caused connection abort (0x00002745/10053)" echo # echo ======================================== echo Rare SSL failures on eelpout python3 -c "NUMITERATIONS=10;NUMTESTS=10;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"ssl_{i}/099_rare_ssl_failures \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test --num-processes {NUMTESTS} {tsts}\") == 0)')" : # this test fails on Windows sporadically with "server closed the connection unexpectedly" : # this test (v12-compatible variation) fails on 1f39a1c06~1 (on iterations 1, 1, 1 for me) : # PG_TEST_EXTRA=ssl make -s check -C src/test/ssl; rm -rf src/test/ssl_*; for i in `seq 20`; do cp -r src/test/ssl/ src/test/ssl_$i; sed "s|src/test/ssl|src/test/ssl_$i|" -i src/test/ssl_$i/Makefile; done; for ((i=1;i<=10;i++)); do echo "ITERATION $i"; parallel --halt now,fail=1 -j20 --linebuffer --tag PG_TEST_EXTRA=ssl make -s check -C src/test/ssl_{} PROVE_TESTS="t/099_rare_ssl_failures-v12.pl" NO_TEMP_INSTALL=1 ::: `seq 20` || break; done echo # echo ======================================== echo pgsql: Add tests for '-f' option in dropdb utility. meson test test_misc/051_dropdb_force : # this test fails on Windows without 6051857fc due to "psql::4: server closed the connection unexpectedly" grep -r "psql::" "testrun/test_misc/051_dropdb_force" : # this test fails on Windows with 6051857fc due to "psql::4: could not receive data from server: Software caused connection abort (0x00002745/10053)" echo # echo ======================================== echo libpq copy error handling busted meson test test_misc/099_pgbench_with_server_off : # this test fails before 7247e243a, to revert that commit: : # git show 0245f8db3 src/interfaces/libpq/fe-secure.c | git apply -R && git show a9e9a9f32 src/interfaces/libpq/fe-secure.c | git apply -R && git show faa189c932d | git apply -R : # git show 7247e243a | git apply -R : # this test passes after 7247e243a, also survives 50 iterations x 10 parallel processes : # python3 -c "NUMITERATIONS=10;NUMTESTS=10;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"test_misc_{i}/099_pgbench_with_server_off \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test --num-processes {NUMTESTS} {tsts}\") == 0)')" echo # echo ======================================== echo BUG 16678: The ecpg connect/test5 test sometimes fails on Windows perl -i.bak -pe "s/(.*OK, try to read some data)/pg_usleep(10000L);\n\1/" "../src/interfaces/libpq/fe-misc.c" perl -i.bak -pe "s/(.*WalSndWait\(wakeEvents, sleeptime, WAIT_EVENT_WAL_SENDER_MAIN\);)/\1\npg_usleep(11000L);/" "../src/backend/replication/walsender.c" : # sleep in walsender.c needed due to the anomaly "walsender cannot exit" : # Without it, these tests fail on Linux and on Windows: recovery/001_stream_rep recovery/009_twophase recovery/012_subtransactions recovery/021_row_visibility recovery/032_relfilenode_reuse recovery/035_standby_logical_decoding pg_rewind/008_min_recovery_point ninja && meson test --suite setup meson test ecpg/ecpg meson test pg_dump/002_pg_dump : # Failed tests, fixed with 6051857fc: pg_upgrade/002_pg_upgrade isolation/isolation recovery/019_replslot_limit recovery/037_invalid_database test_decoding/isolation ecpg/ecpg pg_amcheck/002_nonesuch pg_dump/002_pg_dump pgbench/001_pgbench_with_server psql/001_basic scripts/011_clusterdb_all scripts/091_reindexdb_all scripts/101_vacuumdb_all cd .. && git show 6051857fc | git apply && cd build && ninja && meson test --suite setup meson test pg_upgrade/002_pg_upgrade isolation/isolation recovery/019_replslot_limit recovery/037_invalid_database test_decoding/isolation ecpg/ecpg pg_amcheck/002_nonesuch pg_dump/002_pg_dump pgbench/001_pgbench_with_server psql/001_basic scripts/011_clusterdb_all scripts/091_reindexdb_all scripts/101_vacuumdb_all : # Test recovery/019_replslot_limit fails on Linux with the delay added, but doesn't fail on Windows (with 6051857fc) echo # echo ======================================== echo MSVC SSL test failure meson test ssl/001_ssltests : # this test fails (on a first run, with the sleep added) after 6051857fc with an error "server closed the connection unexpectedly" cd .. && git show ed52c3707 | git apply && cd build && ninja && meson test --suite setup meson test ssl/001_ssltests : # this test passes (with the sleep added) after 6051857fc + ed52c3707 echo # echo ======================================== echo Why is src/test/modules/committs/t/002_standby.pl flaky? cd .. git restore "src/interfaces/libpq/fe-misc.c" "src/backend/replication/walsender.c" git show 6051857fc | git apply && git show ed52c3707 | git apply cd build && ninja >ninja.log && meson test --suite setup python3 -c "NUMITERATIONS=10;NUMTESTS=10;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"test_misc_{i}/099_commit_ts_002_standby \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test --num-processes {NUMTESTS} {tsts}\") == 0)')" : # this test failed on iterations 1, 3, 1 for me (without the sleep but with 6051857fc + ed52c3707) python3 -c "NUMITERATIONS=10;NUMTESTS=1;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"postgres_fdw_{i}/099_postgres_fdw_disconnect \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test -t 0.2 --num-processes {NUMTESTS} {tsts}\") == 0)')" : # this test also failed (with TIMEOUT) on iterations 4, 6, 2 for me cd .\\. && echo Killing postgres processes left behind failing tests && taskkill /F /FI "IMAGENAME eq postgres.exe" cd .. && git show ed52c3707 | git apply -R && git show 6051857fc | git apply -R && cd build && ninja >ninja.log && meson test --suite setup python3 -c "NUMITERATIONS=10;NUMTESTS=10;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"test_misc_{i}/099_commit_ts_002_standby \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test --num-processes {NUMTESTS} {tsts}\") == 0)')" : # 10 iterations succeeded (without the sleep and without 6051857fc + ed52c3707) echo # echo ======================================== echo BUG 17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0 : # Linux-only part; use make because meson.build doesn't play well with libressl for now : && cd .. : # Revert faa189c93 (we also need non-essential changes a9e9a9f32 and 0245f8db3 above) : && git show 0245f8db3 src/interfaces/libpq/fe-secure.c | git apply -R && git show a9e9a9f32 src/interfaces/libpq/fe-secure.c | git apply -R && git show faa189c93 | git apply -R : && ( cd /tmp/ && rm -rf libressl*; wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.1.tar.gz && tar fax libressl-3.4.1.tar.gz && cd libressl-3.4.1/ && ./configure -q --prefix=/tmp/libressl && make -j`nproc` >/dev/null && make install >/dev/null ) : && PATH="/tmp/libressl/bin/:$PATH" sh -c "./configure --enable-tap-tests --with-ssl=openssl --with-includes=/tmp/libressl/include --with-libs=/tmp/libressl/lib && make -s -j8" : && PG_TEST_EXTRA='ssl' LD_LIBRARY_PATH="/tmp/libressl/lib" make -s check -C src/test/ssl PROVE_TESTS="t/001*" : # this test fails without faa189c93 : && grep -r '# skip SSL_CERT_FILE is not supported' src/test/ssl/tmp_check/log/ # make sure that LibreSSL is used : && make -s clean : # Undo all the changes : && git show faa189c93 | git apply && git show a9e9a9f32 src/interfaces/libpq/fe-secure.c | git apply && git show 0245f8db3 src/interfaces/libpq/fe-secure.c | git apply : && PATH="/tmp/libressl/bin/:$PATH" sh -c "./configure --enable-tap-tests --with-ssl=openssl --with-includes=/tmp/libressl/include --with-libs=/tmp/libressl/lib && make -s -j8" : && PG_TEST_EXTRA='ssl' LD_LIBRARY_PATH="/tmp/libressl/lib" make -s check -C src/test/ssl PROVE_TESTS="t/001*" : # this test passes with faa189c93 (on current master) : && grep -r '# skip SSL_CERT_FILE is not supported' src/test/ssl/tmp_check/log/ # make sure that LibreSSL is used : && make -s clean && make -s distclean && cd build echo # echo ======================================== echo Applying all the latest patches cd .. git apply v2-0001-simplehash-Allow-raw-memory-to-be-freed.patch v2-0002-simplehash-Allow-raw-allocation-to-fail.patch git apply v2-0003-Redesign-Windows-socket-event-management.patch git apply v2-0004-Remove-pgwin32_select.patch git apply v2-0005-Refactor-pgwin32_waitforsinglesocket-to-share-eve.patch git apply v2-0006-Reinstate-graceful-shutdown-changes-for-Windows.patch cd build && ninja >ninja.log && meson test --suite setup echo # echo ======================================== echo Checking whether commit_ts_002_standby is still flaky... python3 -c "NUMITERATIONS=10;NUMTESTS=10;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"test_misc_{i}/099_commit_ts_002_standby \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test --num-processes {NUMTESTS} {tsts}\") == 0)')" : # no failures on Linux and Windows echo Checking whether 099_postgres_fdw_disconnect is still flaky... python3 -c "NUMITERATIONS=10;NUMTESTS=1;import os;tsts='';exec('for i in range(1,NUMTESTS+1): tsts+=f\"postgres_fdw_{i}/099_postgres_fdw_disconnect \"'); exec('for i in range(1,NUMITERATIONS+1):print(f\"iteration {i}\"); assert(os.system(f\"meson test -t 0.2 --num-processes {NUMTESTS} {tsts}\") == 0)')" : # no failures on Linux and Windows : # tests 051_dropdb_force, 099_case_15598 still fail on Windows due to the anomaly "send() before recv() invalidates a closed socket"