diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2025-09-24 12:08:55 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2025-09-24 12:09:11 -0400 |
commit | 7ccbf6d8b5e5a4f45cb77e25f16afcf13cf1dfd3 (patch) | |
tree | b44890ed215d37b8f67726a850d8aa8460fb25a7 | |
parent | 7fcb32ad023a434e07b7214c1c762ecd410b6969 (diff) |
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
-rw-r--r-- | src/bin/pg_test_timing/t/001_basic.pl | 17 |
1 files changed, 13 insertions, 4 deletions
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(); |