Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6be579e

Browse files
committed
Some fixes
1 parent d41cc96 commit 6be579e

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PostgresNode;
66
use TestLib;
7-
use Test::More;
7+
use Test::More tests => 21;
88

99
# Wait until replay to complete
1010
sub replay_wait( $$ ) {
@@ -86,11 +86,11 @@ ( $$ )
8686
ok( $snapshot_size eq 't', 'Snapshot size is greater than 0 on standby' );
8787

8888
my $snapshot_timestamp = $node_standby->safe_psql( 'postgres', "select ( now() - pg_get_snapshot_timestamp( 1 ) ) > interval '0 seconds'" );
89-
ok( $snapshot_size eq 't', 'Snapshot age is greater than 0 on standby' );
89+
ok( $snapshot_timestamp eq 't', 'Snapshot age is greater than 0 on standby' );
9090
$snapshot_timestamp = $node_standby->safe_psql( 'postgres', "select ( now() - pg_get_snapshot_timestamp( 1 ) ) < interval '180 seconds'" );
91-
ok( $snapshot_size eq 't', 'Snapshot age is less than 180 seconds on standby' );
91+
ok( $snapshot_timestamp eq 't', 'Snapshot age is less than 180 seconds on standby' );
9292

93-
( $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;" );
93+
( $ret, $stdout, $stderr ) = $node_standby->psql( 'postgres', "select coalesce( pg_get_snapshot_timestamp( snap_id ), now() ) = coalesce( snap_created, now() ) and pg_size_pretty( pg_get_snapshot_size( snap_id ) ) = snap_size from snapfs_snapshots;" );
9494
$ret = () = $stdout =~ /t/g;
9595
is( $ret, 3, 'snapfs_snapshots view check on standby' );
9696

@@ -106,11 +106,11 @@ ( $$ )
106106
ok( $snapshot_size eq 't', 'Snapshot size is greater than 0 on master' );
107107

108108
$snapshot_timestamp = $node_master->safe_psql( 'postgres', "select ( now() - pg_get_snapshot_timestamp( 1 ) ) > interval '0 seconds'" );
109-
ok( $snapshot_size eq 't', 'Snapshot age is greater than 0 on master' );
109+
ok( $snapshot_timestamp eq 't', 'Snapshot age is greater than 0 on master' );
110110
$snapshot_timestamp = $node_master->safe_psql( 'postgres', "select ( now() - pg_get_snapshot_timestamp( 1 ) ) < interval '180 seconds'" );
111-
ok( $snapshot_size eq 't', 'Snapshot age is less than 180 seconds on master' );
111+
ok( $snapshot_timestamp eq 't', 'Snapshot age is less than 180 seconds on master' );
112112

113-
( $ret, $stdout, $stderr ) = $node_master->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;" );
113+
( $ret, $stdout, $stderr ) = $node_master->psql( 'postgres', "select coalesce( pg_get_snapshot_timestamp( snap_id ), now() ) = coalesce( snap_created, now() ) and pg_size_pretty( pg_get_snapshot_size( snap_id ) ) = snap_size from snapfs_snapshots;" );
114114
$ret = () = $stdout =~ /t/g;
115115
is( $ret, 3, 'snapfs_snapshots view check on master' );
116116

@@ -126,5 +126,3 @@ ( $$ )
126126
( $ret, $stdout, $stderr ) = $node_master->psql( 'postgres', "select pg_switch_to_snapshot( 0 );" );
127127
$ret = $node_master->safe_psql( 'postgres', "select pg_recover_to_snapshot( 2 );" );
128128
ok( $ret eq '', 'pg_recover_to_snapshot() on master' );
129-
130-
done_testing();

src/test/recovery/t/017_snapfs_replication_checks.pl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
use PostgresNode;
66
use TestLib;
7-
use Test::More;
7+
use Test::More tests => 50;
8+
use Data::Dumper;
89

910
# Wait until replay to complete
1011
sub replay_wait( $$ ) {
@@ -369,6 +370,3 @@ ( $$ )
369370
$ret_standby = $node_standby->safe_psql( 'postgres',
370371
"select rolname, rolcanlogin from pg_roles where rolname = 'regression_testrole';" );
371372
ok( $ret_standby eq '', 'recover to snapshot 1 role standby check' );
372-
373-
374-
done_testing();

0 commit comments

Comments
 (0)