Remove testing for precise LSN/reserved bytes in new TAP test
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 7 Apr 2020 23:16:37 +0000 (19:16 -0400)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Apr 2020 03:28:27 +0000 (23:28 -0400)
Trying to ensure that a slot's restart_lsn or amount of reserved bytes
exactly match some specific values seems unnecessary, and fragile as
shown by failures in multiple buildfarm members.

Discussion: https://postgr.es/m/20200407232602.GA21559@alvherre.pgsql

src/test/recovery/t/019_replslot_limit.pl

index 8a0542e8afa82b80ed80743d0c61f337fab65daa..dac8f80096286dd2a77e1ab99e83d3c2e30bad5b 100644 (file)
@@ -121,8 +121,8 @@ $node_standby->stop;
 advance_wal($node_master, 6);
 
 # Slot gets into 'reserved' state
-$result = $node_master->safe_psql('postgres', "SELECT restart_lsn, wal_status, pg_size_pretty(restart_lsn - min_safe_lsn) as remain FROM pg_replication_slots WHERE slot_name = 'rep1'");
-is($result, "$start_lsn|reserved|216 bytes", 'check that the slot state changes to "reserved"');
+$result = $node_master->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'");
+is($result, "reserved", 'check that the slot state changes to "reserved"');
 
 # do checkpoint so that the next checkpoint runs too early
 $node_master->safe_psql('postgres', "CHECKPOINT;");
@@ -131,8 +131,8 @@ $node_master->safe_psql('postgres', "CHECKPOINT;");
 advance_wal($node_master, 1);
 
 # Slot gets into 'lost' state
-$result = $node_master->safe_psql('postgres', "SELECT restart_lsn, wal_status, min_safe_lsn is NULL FROM pg_replication_slots WHERE slot_name = 'rep1'");
-is($result, "$start_lsn|lost|t", 'check that the slot state changes to "lost"');
+$result = $node_master->safe_psql('postgres', "SELECT wal_status FROM pg_replication_slots WHERE slot_name = 'rep1'");
+is($result, "lost", 'check that the slot state changes to "lost"');
 
 # The standby still can connect to master before a checkpoint
 $node_standby->start;