Hi, On Tue, 1 Sept 2026 at 11:23, Michael Paquier <[email protected]> wrote: > > As far as I remember my read of the patch yesterday, various --limit=1 > additions don't really matter because we do not care about checking > dedicated output patterns: we just want to make a quick check that some > command pattern works. If we only include these, how much time are we > able to cut? I'd guess that it would still be a nice chunk, but I did > not test.. And we could backpatch that as well.
Here is v2, which adds '--limit=1' to tests that check the command pattern works. Commit message is updated accordingly. - On my Linux computer, total time of 10 of 'pg_waldump/001_basic' tests is reduced from 33s to 28s. - On Windows CI it is reduced from 430s to 200s. -- Regards, Nazir Bilal Yavuz Microsoft
From 2eee83c4022dc8aca083f0371e9e864872bf67af Mon Sep 17 00:00:00 2001 From: Sehrope Sarkuni <[email protected]> Date: Fri, 28 Aug 2026 23:57:26 +0000 Subject: [PATCH v2] Speed up pg_waldump TAP test Several invocations decoded and printed the full WAL range even though the test only needs to confirm that a command form works or that decoding reaches a specific error. Limit those checks to one record, and start the fall-off-the-end checks near the end of the generated WAL. Keep checks that validate filtered output unrestricted so they continue to examine every matching record, including for tar and gzip inputs. This reduces IPC overhead, particularly on Windows, without weakening that coverage. --- src/bin/pg_waldump/t/001_basic.pl | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/bin/pg_waldump/t/001_basic.pl b/src/bin/pg_waldump/t/001_basic.pl index 4fa507cfa20..8beac19eaff 100644 --- a/src/bin/pg_waldump/t/001_basic.pl +++ b/src/bin/pg_waldump/t/001_basic.pl @@ -243,8 +243,14 @@ command_fails_like( [ 'pg_waldump', 'foo', 'bar' ], qr/error: could not locate WAL file "foo"/, 'start file not found'); -command_like([ 'pg_waldump', $node->data_dir . '/pg_wal/' . $start_walfile ], - qr/./, 'runs with start segment specified'); +command_like( + [ + 'pg_waldump', + '--limit' => 1, + $node->data_dir . '/pg_wal/' . $start_walfile + ], + qr/./, + 'runs with start segment specified'); command_fails_like( [ 'pg_waldump', $node->data_dir . '/pg_wal/' . $start_walfile, 'bar' ], qr/error: could not open file "bar"/, @@ -252,6 +258,7 @@ command_fails_like( command_like( [ 'pg_waldump', + '--limit' => 1, $node->data_dir . '/pg_wal/' . $start_walfile, $node->data_dir . '/pg_wal/' . $end_walfile ], @@ -260,6 +267,7 @@ command_like( command_like( [ 'pg_waldump', '--quiet', + '--limit' => 1, '--path', $node->data_dir . '/pg_wal/', $start_walfile ], @@ -313,6 +321,7 @@ sub test_pg_waldump_skip_bytes '--start' => $new_start, '--end' => $endlsn, '--path' => $path, + '--limit' => 1, ], '>' => \$stdout, '2>' => \$stderr; @@ -425,14 +434,18 @@ for my $scenario (@scenarios) '--path' => $path, '--start' => $start_lsn, '--end' => $end_lsn, + '--limit' => 1, ], qr/./, 'runs with path option and start and end locations'); + + # Start near the end to avoid decoding records that are not relevant + # to the fall-off-the-end tests. command_fails_like( [ 'pg_waldump', '--path' => $path, - '--start' => $start_lsn, + '--start' => $contrecord_lsn, ], qr/error: error in WAL record at/, 'falling off the end of the WAL results in an error'); @@ -441,7 +454,7 @@ for my $scenario (@scenarios) [ 'pg_waldump', '--quiet', '--path' => $path, - '--start' => $start_lsn + '--start' => $contrecord_lsn ], qr/error: error in WAL record at/, 'errors are shown with --quiet'); -- 2.47.3
