From: Tom Lane Date: Wed, 24 Sep 2025 16:08:55 +0000 (-0400) Subject: Include pg_test_timing's full output in the TAP test log. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ccbf6d8b5e5a4f45cb77e25f16afcf13cf1dfd3;p=thirdparty%2Fpostgresql.git Include pg_test_timing's full output in the TAP test log. We were already doing a short (1-second) pg_test_timing run during check-world and buildfarm runs. But we weren't doing anything with the result except for a basic regex-based sanity check. Collecting that output from buildfarm runs is seeming very attractive though, because it would help us determine what sort of timing resolution is available on supported platforms. It's not very long, so let's just note it verbatim in the TAP log. Discussion: https://postgr.es/m/3321785.1758728271@sss.pgh.pa.us --- diff --git a/src/bin/pg_test_timing/t/001_basic.pl b/src/bin/pg_test_timing/t/001_basic.pl index 9912acc052a..040e62247ee 100644 --- a/src/bin/pg_test_timing/t/001_basic.pl +++ b/src/bin/pg_test_timing/t/001_basic.pl @@ -33,14 +33,23 @@ command_fails_like( ######################################### # We obviously can't check for specific output, but we can # do a simple run and make sure it produces something. - -command_like( - [ 'pg_test_timing', '--duration' => '1' ], +# Also, note the output in the log for data collection purposes. + +my $cmd = [ 'pg_test_timing', '--duration' => '1' ]; +my ($stdout, $stderr); +print("# Running: " . join(" ", @{$cmd}) . "\n"); +my $result = IPC::Run::run $cmd, '>' => \$stdout, '2>' => \$stderr; +is($result, 1, "pg_test_timing: exit code 0"); +is($stderr, '', "pg_test_timing: no stderr"); +like( + $stdout, qr/ \QTesting timing overhead for 1 second.\E.* \QHistogram of timing durations:\E.* \QObserved timing durations up to 99.9900%:\E /sx, - 'pg_test_timing: sanity check'); + 'pg_test_timing: stdout passes sanity check'); + +note "pg_test_timing results:\n$stdout\n"; done_testing();