Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd3676a2

Browse files
committed
Close psql processes gracefully in recovery tests
Under windows, psql processes need to be ended explicitly, or the TAPtests hang. However, the recovery tests were doing this viaIPC::Run::kill_kill(), which causes other major problems on Windows.We solve this by instead sending '\q' to psql so it quits of its ownaccord, and then simply waiting for it. This means we can now run almostall the recovery tests on all Windows platforms.Discussion:https://postgr.es/m/20210301200715.tdjpuesfzebpffgn@alap3.anarazel.de
1 parent040af77 commitd3676a2

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

‎src/test/recovery/t/011_crash_recovery.pl‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,8 @@
77
use TestLib;
88
use Test::More;
99
use Config;
10-
if ($Config{osname}eq'MSWin32')
11-
{
1210

13-
# some Windows Perls at least don't like IPC::Run's start/kill_kill regime.
14-
planskip_all=>"Test fails on Windows perl";
15-
}
16-
else
17-
{
18-
plantests=> 3;
19-
}
11+
plantests=> 3;
2012

2113
my$node = get_new_node('primary');
2214
$node->init(allows_streaming=> 1);
@@ -65,4 +57,5 @@
6557
is($node->safe_psql('postgres',qq[SELECT pg_xact_status('$xid');]),
6658
'aborted','xid is aborted after crash');
6759

68-
$tx->kill_kill;
60+
$stdin .="\\q\n";
61+
$tx->finish;# wait for psql to quit gracefully

‎src/test/recovery/t/021_row_visibility.pl‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,12 @@
151151
qr/will_commit.*\n\(1 row\)$/m),
152152
'finished prepared visible');
153153

154-
# explicitly shut down psql instances - they cause hangs on windows
155-
$psql_primary{run}->kill_kill;
156-
$psql_standby{run}->kill_kill;
154+
# explicitly shut down psql instances gracefully - to avoid hangs
155+
# or worse on windows
156+
$psql_primary{stdin} .="\\q\n";
157+
$psql_primary{run}->finish;
158+
$psql_standby{stdin} .="\\q\n";
159+
$psql_standby{run}->finish;
157160

158161
$node_primary->stop;
159162
$node_standby->stop;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp