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

Commit734cb4c

Browse files
committed
Avoid tests which crash the calling process on Windows
Certain recovery tests use the Perl IPC::Run module's start/kill_killmethod of processing. On at least some versions of perl this causes thewhole process and its caller to crash. If we ever find a better way ofdoing these tests they can be re-enabled on this platform. This does notaffect Mingw or Cygwin builds, which use a different perl and adifferent shell and so are not affected.
1 parent024711b commit734cb4c

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

‎src/test/recovery/t/006_logical_decoding.pl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use PostgresNode;
99
use TestLib;
1010
use Test::Moretests=> 16;
11+
use Config;
1112

1213
# Initialize master node
1314
my$node_master = get_new_node('master');
@@ -72,13 +73,19 @@
7273
$node_master->safe_psql('otherdb',qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]);
7374

7475
# make sure you can't drop a slot while active
75-
my$pg_recvlogical = IPC::Run::start(['pg_recvlogical','-d',$node_master->connstr('otherdb'),'-S','otherdb_slot','-f','-','--start']);
76-
$node_master->poll_query_until('otherdb',"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)");
77-
is($node_master->psql('postgres','DROP DATABASE otherdb'), 3,
78-
'dropping a DB with inactive logical slots fails');
79-
$pg_recvlogical->kill_kill;
80-
is($node_master->slot('otherdb_slot')->{'slot_name'},undef,
81-
'logical slot still exists');
76+
SKIP:
77+
{
78+
# some Windows Perls at least don't like IPC::Run's start/kill_kill regime.
79+
skip"Test fails on Windows perl", 2if$Config{osname}eq'MSWin32';
80+
81+
my$pg_recvlogical = IPC::Run::start(['pg_recvlogical','-d',$node_master->connstr('otherdb'),'-S','otherdb_slot','-f','-','--start']);
82+
$node_master->poll_query_until('otherdb',"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NOT NULL)");
83+
is($node_master->psql('postgres','DROP DATABASE otherdb'), 3,
84+
'dropping a DB with inactive logical slots fails');
85+
$pg_recvlogical->kill_kill;
86+
is($node_master->slot('otherdb_slot')->{'slot_name'},undef,
87+
'logical slot still exists');
88+
}
8289

8390
$node_master->poll_query_until('otherdb',"SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)");
8491
is($node_master->psql('postgres','DROP DATABASE otherdb'), 0,

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@
55
use warnings;
66
use PostgresNode;
77
use TestLib;
8-
use Test::Moretests=> 3;
8+
use Test::More;
9+
use Config;
10+
if ($Config{osname}eq'MSWin32')
11+
{
12+
# some Windows Perls at least don't like IPC::Run's start/kill_kill regime.
13+
planskip_all=>"Test fails on Windows perl";
14+
}
15+
else
16+
{
17+
plantests=> 3;
18+
}
919

1020
my$node = get_new_node('master');
1121
$node->init(allows_streaming=> 1);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp