postgres.git / summary / log / commit / refs
commit 734cb4c2e7de92972c01b6339a3e15ac4bc605dd
Author: Andrew Dunstan <andrew@dunslane.net>
Date: Fri May 12 10:41:23 2017 +0000
First released in: 10.0
Avoid tests which crash the calling process on Windows
Certain recovery tests use the Perl IPC::Run module's start/kill_kill
method of processing. On at least some versions of perl this causes the
whole process and its caller to crash. If we ever find a better way of
doing these tests they can be re-enabled on this platform. This does not
affect Mingw or Cygwin builds, which use a different perl and a
different shell and so are not affected.
src/test/recovery/t/006_logical_decoding.pl | 21 ++++++++++++++-------
src/test/recovery/t/011_crash_recovery.pl | 12 +++++++++++-
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl
index 31b1218cc06..1430c12923f 100644
--- a/src/test/recovery/t/006_logical_decoding.pl
+++ b/src/test/recovery/t/006_logical_decoding.pl
@@ -8,6 +8,7 @@ use warnings;
use PostgresNode;
use TestLib;
use Test::More tests => 16;
+use Config;
# Initialize master node
my $node_master = get_new_node('master');
@@ -72,13 +73,19 @@ is($node_master->psql('otherdb', "SELECT lsn FROM pg_logical_slot_peek_changes('
$node_master->safe_psql('otherdb', qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]);
# make sure you can't drop a slot while active
-my $pg_recvlogical = IPC::Run::start(['pg_recvlogical', '-d', $node_master->connstr('otherdb'), '-S', 'otherdb_slot', '-f', '-', '--start']);
-$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)");
-is($node_master->psql('postgres', 'DROP DATABASE otherdb'), 3,
- 'dropping a DB with inactive logical slots fails');
-$pg_recvlogical->kill_kill;
-is($node_master->slot('otherdb_slot')->{'slot_name'}, undef,
- 'logical slot still exists');
+SKIP:
+{
+ # some Windows Perls at least don't like IPC::Run's start/kill_kill regime.
+ skip "Test fails on Windows perl", 2 if $Config{osname} eq 'MSWin32';
+
+ my $pg_recvlogical = IPC::Run::start(['pg_recvlogical', '-d', $node_master->connstr('otherdb'), '-S', 'otherdb_slot', '-f', '-', '--start']);
+ $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)");
+ is($node_master->psql('postgres', 'DROP DATABASE otherdb'), 3,
+ 'dropping a DB with inactive logical slots fails');
+ $pg_recvlogical->kill_kill;
+ is($node_master->slot('otherdb_slot')->{'slot_name'}, undef,
+ 'logical slot still exists');
+}
$node_master->poll_query_until('otherdb', "SELECT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'otherdb_slot' AND active_pid IS NULL)");
is($node_master->psql('postgres', 'DROP DATABASE otherdb'), 0,
diff --git a/src/test/recovery/t/011_crash_recovery.pl b/src/test/recovery/t/011_crash_recovery.pl
index 3c3718e6aa4..6e924d69554 100644
--- a/src/test/recovery/t/011_crash_recovery.pl
+++ b/src/test/recovery/t/011_crash_recovery.pl
@@ -5,7 +5,17 @@ use strict;
use warnings;
use PostgresNode;
use TestLib;
-use Test::More tests => 3;
+use Test::More;
+use Config;
+if ($Config{osname} eq 'MSWin32')
+{
+ # some Windows Perls at least don't like IPC::Run's start/kill_kill regime.
+ plan skip_all => "Test fails on Windows perl";
+}
+else
+{
+ plan tests => 3;
+}
my $node = get_new_node('master');
$node->init(allows_streaming => 1);
[parent: 024711bb5446]