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

Commit ac8c85d

Browse files
committed
Improve stability of subscription/029_on_error.pl
This test was failing when using wal_debug=on and -DWAL_DEBUG because of additional log entries that made the test grab an LSN not mapping with the error expected in the test. Previously the test would look for the first matching line to get the LSN to skip up to. This is improved by having the test scan the logs with a regexp that checks for the expected ERROR string, ensuring that the wanted LSN comes from the correct context. Backpatch down to 15 where this test has been introduced. Author: Ian Ilyasov Discussion: https://postgr.es/m/GV1P251MB100415F17E6B2FDD7188777ECDE32@GV1P251MB1004.EURP251.PROD.OUTLOOK.COM Backpatch-through: 15
1 parent 0162a9b commit ac8c85d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/subscription/t/029_on_error.pl

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ sub test_skip_lsn
2626
"SELECT subenabled = FALSE FROM pg_subscription WHERE subname = 'sub'"
2727
);
2828

29-
# Get the finish LSN of the error transaction.
29+
# Get the finish LSN of the error transaction, mapping the expected
30+
# ERROR with its CONTEXT when retrieving this information.
3031
my $contents = slurp_file($node_subscriber->logfile, $offset);
3132
$contents =~
32-
qr/processing remote data for replication origin \"pg_\d+\" during message type "INSERT" for replication target relation "public.tbl" in transaction \d+, finished at ([[:xdigit:]]+\/[[:xdigit:]]+)/
33+
qr/duplicate key value violates unique constraint "tbl_pkey".*\n.*DETAIL:.*\n.*CONTEXT:.* for replication target relation "public.tbl" in transaction \d+, finished at ([[:xdigit:]]+\/[[:xdigit:]]+)/m
3334
or die "could not get error-LSN";
3435
my $lsn = $1;
3536

0 commit comments

Comments
 (0)