|
8 | 8 | use PostgresNode;
|
9 | 9 | use TestLib;
|
10 | 10 | use Test::More tests => 16;
|
| 11 | +use Config; |
11 | 12 |
|
12 | 13 | # Initialize master node
|
13 | 14 | my $node_master = get_new_node('master');
|
|
72 | 73 | $node_master->safe_psql('otherdb', qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]);
|
73 | 74 |
|
74 | 75 | # 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", 2 if $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 | +} |
82 | 89 |
|
83 | 90 | $node_master->poll_query_until('otherdb', "SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)");
|
84 | 91 | is($node_master->psql('postgres', 'DROP DATABASE otherdb'), 0,
|
|
0 commit comments