Unbreak recovery test on Windows
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 21 Mar 2021 15:52:30 +0000 (11:52 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 21 Mar 2021 15:56:09 +0000 (11:56 -0400)
On Windows we need to send explicit quit messages to psql or the TAP tests
can hang.

src/test/recovery/t/022_crash_temp_files.pl

index c5624fe864463ad6b8f42393a822a3eee822750a..03c8ae3bd71d4e368ccc2e2935113ddabe6baa40 100644 (file)
@@ -124,8 +124,10 @@ $killme_stderr2 = '';
 my $ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
 is($ret, 0, 'killed process with KILL');
 
-# Close psql session
+# Explicitly shut down psql gracefully - to avoid hangs or worse on windows
+$killme_stdin .= "\\q\n";
 $killme->finish;
+$killme_stdin2 .= "\\q\n";
 $killme2->finish;
 
 # Wait till server restarts
@@ -212,8 +214,10 @@ $killme_stderr2 = '';
 $ret = TestLib::system_log('pg_ctl', 'kill', 'KILL', $pid);
 is($ret, 0, 'killed process with KILL');
 
-# Close psql session
+# Explicitly shut down psql gracefully - to avoid hangs or worse on windows
+$killme_stdin .= "\\q\n";
 $killme->finish;
+$killme_stdin2 .= "\\q\n";
 $killme2->finish;
 
 # Wait till server restarts