Skip to content

Commit a758f23

Browse files
committed
pg_basebackup supports snapshots now. So we changed the test.
1 parent 64b55ea commit a758f23

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/test/recovery/t/016_snapfs_simple_checks.pl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ ( $$ )
5555

5656
replay_wait( $node_master, $node_standby );
5757

58+
# replay_wait() does not work correctly
59+
my $master_out = $node_master->safe_psql( 'postgres', "select pg_sleep(1);" );
60+
5861
# Check for pg_control_snapshot() results
59-
my $master_out = $node_master->safe_psql( 'postgres', "select * from pg_control_snapshot()" );
62+
$master_out = $node_master->safe_psql( 'postgres', "select * from pg_control_snapshot()" );
6063
my $standby_out = $node_standby->safe_psql( 'postgres', "select * from pg_control_snapshot()" );
6164

6265
ok( $master_out eq '1|3|0', 'pg_control_snapshot() on master' );
63-
ok( $standby_out eq '1|2|0', 'pg_control_snapshot() on standby' );
66+
ok( $standby_out eq '1|3|0', 'pg_control_snapshot() on standby' );
6467

6568
# Standby simple checks
6669
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_make_snapshot();" );
@@ -72,7 +75,7 @@ ( $$ )
7275
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_switch_to_snapshot( 2 );" );
7376
like( $stderr, '/ERROR: Operation is not possible at replica/', 'pg_recover_to_snapshot() is prohibited on standby' );
7477

75-
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_set_backend_snapshot( 3 );" );
78+
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select pg_set_backend_snapshot( 4 );" );
7679
like( $stderr, '/ERROR: Invalid snapshot/', 'Invalid snapshot number passed to pg_set_backend_snapshot() on standby' );
7780

7881
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select * from pg_set_backend_snapshot( 2 ); select * from pg_get_backend_snapshot(); select * from pg_set_backend_snapshot( 0 );" );
@@ -89,8 +92,7 @@ ( $$ )
8992

9093
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select coalesce( pg_get_snapshot_timestamp( generate_series ), now() ) = coalesce( pg_get_snapshot_timestamp, now() ) and pg_size_pretty( pg_get_snapshot_size( generate_series ) ) = pg_size_pretty from snapfs_snapshots;" );
9194
$ret = () = $stdout =~ /t/g;
92-
is( $ret, 2, 'snapfs_snapshots view check on standby' );
93-
95+
is( $ret, 3, 'snapfs_snapshots view check on standby' );
9496

9597
# Master simple checks
9698
( $ret, $stdout, $stderr ) = $node_master->psql( 'postgres', "select pg_set_backend_snapshot( 4 );" );

0 commit comments

Comments
 (0)