Fix instability in 026_overwrite_contrecord.pl test.
authorTom Lane <[email protected]>
Tue, 9 Nov 2021 23:40:19 +0000 (18:40 -0500)
committerTom Lane <[email protected]>
Tue, 9 Nov 2021 23:40:19 +0000 (18:40 -0500)
We've seen intermittent failures in this test on slower buildfarm
machines, which I think can be explained by assuming that autovacuum
emitted some additional WAL.  Disable autovacuum to stabilize it.

In passing, use stringwise not numeric comparison to compare
WAL file names.  Doesn't matter at present, but they are
hex strings not decimal ...

Discussion: https://postgr.es/m/1372189.1636499287@sss.pgh.pa.us

src/test/recovery/t/026_overwrite_contrecord.pl

index ef0fdc2c604ba6e7cfe067bc626fef95f04f1eac..57b2a6b7fb92aff5e4e36e1c26f6ae6a34f3ffc5 100644 (file)
@@ -19,7 +19,12 @@ plan tests => 3;
 
 my $node = PostgresNode->get_new_node('primary');
 $node->init(allows_streaming => 1);
-$node->append_conf('postgresql.conf', 'wal_keep_segments=16');
+# We need these settings for stability of WAL behavior.
+$node->append_conf(
+   'postgresql.conf', qq(
+autovacuum = off
+wal_keep_segments = 16
+));
 $node->start;
 
 $node->safe_psql('postgres', 'create table filler (a int, b text)');
@@ -61,7 +66,7 @@ qq{SELECT pg_logical_emit_message(true, 'test 026', repeat('xyzxz', 123456))}
 #$node->safe_psql('postgres', qq{create table foo ()});
 my $endfile = $node->safe_psql('postgres',
    'SELECT pg_walfile_name(pg_current_wal_insert_lsn())');
-ok($initfile != $endfile, "$initfile differs from $endfile");
+ok($initfile ne $endfile, "$initfile differs from $endfile");
 
 # Now stop abruptly, to avoid a stop checkpoint.  We can remove the tail file
 # afterwards, and on startup the large message should be overwritten with new