4
4
5
5
use PostgresNode;
6
6
use TestLib;
7
- use Test::More;
7
+ use Test::More tests => 21 ;
8
8
9
9
# Wait until replay to complete
10
10
sub replay_wait ( $$ ) {
@@ -86,11 +86,11 @@ ( $$ )
86
86
ok( $snapshot_size eq ' t' , ' Snapshot size is greater than 0 on standby' );
87
87
88
88
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' );
90
90
$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' );
92
92
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;" );
94
94
$ret = () = $stdout =~ / t/g ;
95
95
is( $ret , 3, ' snapfs_snapshots view check on standby' );
96
96
@@ -106,11 +106,11 @@ ( $$ )
106
106
ok( $snapshot_size eq ' t' , ' Snapshot size is greater than 0 on master' );
107
107
108
108
$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' );
110
110
$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' );
112
112
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;" );
114
114
$ret = () = $stdout =~ / t/g ;
115
115
is( $ret , 3, ' snapfs_snapshots view check on master' );
116
116
@@ -126,5 +126,3 @@ ( $$ )
126
126
( $ret , $stdout , $stderr ) = $node_master -> psql( ' postgres' , " select pg_switch_to_snapshot( 0 );" );
127
127
$ret = $node_master -> safe_psql( ' postgres' , " select pg_recover_to_snapshot( 2 );" );
128
128
ok( $ret eq ' ' , ' pg_recover_to_snapshot() on master' );
129
-
130
- done_testing();
0 commit comments