From b30b7d96161a2e27d80cc96073b44c5266c2b751 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 1 May 2017 12:11:25 -0400 Subject: [PATCH v2 2/2] Remove unnecessary pg_is_in_recovery calls in tests Since pg_ctl promote already waits for recovery to end, these calls are obsolete. --- src/test/modules/commit_ts/t/003_standby_2.pl | 1 - src/test/recovery/t/008_fsm_truncation.pl | 2 -- src/test/recovery/t/009_twophase.pl | 6 ------ src/test/recovery/t/010_logical_decoding_timelines.pl | 3 --- src/test/recovery/t/012_subtransactions.pl | 6 ------ 5 files changed, 18 deletions(-) diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl index 2fd561115c..c3000f5b4c 100644 --- a/src/test/modules/commit_ts/t/003_standby_2.pl +++ b/src/test/modules/commit_ts/t/003_standby_2.pl @@ -55,7 +55,6 @@ $master->restart; system_or_bail('pg_ctl', '-D', $standby->data_dir, 'promote'); -$standby->poll_query_until('postgres', "SELECT pg_is_in_recovery() <> true"); $standby->safe_psql('postgres', "create table t11()"); my $standby_ts = $standby->safe_psql('postgres', diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl index 56eecf722c..ddab464a97 100644 --- a/src/test/recovery/t/008_fsm_truncation.pl +++ b/src/test/recovery/t/008_fsm_truncation.pl @@ -83,8 +83,6 @@ # Promote the standby $node_standby->promote; -$node_standby->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_standby->psql('postgres', 'checkpoint'); # Restart to discard in-memory copy of FSM diff --git a/src/test/recovery/t/009_twophase.pl b/src/test/recovery/t/009_twophase.pl index 13b4a04205..376cb09a25 100644 --- a/src/test/recovery/t/009_twophase.pl +++ b/src/test/recovery/t/009_twophase.pl @@ -195,8 +195,6 @@ PREPARE TRANSACTION 'xact_009_1';"); $node_master->teardown_node; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $psql_rc = $node_slave->psql('postgres', "COMMIT PREPARED 'xact_009_1'"); is($psql_rc, '0', "Restore of prepared transaction on promoted slave"); @@ -227,8 +225,6 @@ $node_master->stop; $node_slave->restart; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_slave->psql( 'postgres', @@ -264,8 +260,6 @@ $node_slave->teardown_node; $node_slave->start; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_slave->psql( 'postgres', diff --git a/src/test/recovery/t/010_logical_decoding_timelines.pl b/src/test/recovery/t/010_logical_decoding_timelines.pl index 65f6ba2fca..98418128d2 100644 --- a/src/test/recovery/t/010_logical_decoding_timelines.pl +++ b/src/test/recovery/t/010_logical_decoding_timelines.pl @@ -135,9 +135,6 @@ $node_master->stop('immediate'); $node_replica->promote; -print "waiting for replica to come up\n"; -$node_replica->poll_query_until('postgres', - "SELECT NOT pg_is_in_recovery();"); $node_replica->safe_psql('postgres', "INSERT INTO decoding(blah) VALUES ('after failover');"); diff --git a/src/test/recovery/t/012_subtransactions.pl b/src/test/recovery/t/012_subtransactions.pl index 30677e1675..c99733cad7 100644 --- a/src/test/recovery/t/012_subtransactions.pl +++ b/src/test/recovery/t/012_subtransactions.pl @@ -109,8 +109,6 @@ is($psql_out, '8128', "Visible"); $node_master->stop; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_slave->psql( 'postgres', @@ -162,8 +160,6 @@ is($psql_out, '-1', "Not visible"); $node_master->stop; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_slave->psql( 'postgres', @@ -205,8 +201,6 @@ is($psql_out, '-1', "Not visible"); $node_master->stop; $node_slave->promote; -$node_slave->poll_query_until('postgres', "SELECT NOT pg_is_in_recovery()") - or die "Timed out while waiting for promotion of standby"; $node_slave->psql( 'postgres', -- 2.13.1