From cd6d836feb9cb4c727a2cbac4cff315d6901a834 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 24 May 2024 20:48:56 +0200 Subject: [PATCH] Add timers tests to 028_temp_block.pl --- t/028_temp_block.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/028_temp_block.pl b/t/028_temp_block.pl index 27db3ce..c1554d1 100644 --- a/t/028_temp_block.pl +++ b/t/028_temp_block.pl @@ -85,11 +85,19 @@ PGSM::append_to_debug_file($stdout); # Compare values for query 'SELECT * FROM t1' ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT PGSM.temp_blks_read != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); trim($stdout); -is($stdout,'t',"Check: shared_blks_hit should not be 0."); +is($stdout,'t',"Check: temp_blks_read should not be 0."); ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT PGSM.temp_blks_written != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); trim($stdout); -is($stdout,'t',"Check: temp_blks_read should not be 0."); +is($stdout,'t',"Check: temp_blks_written should not be 0."); + +($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_read_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); +trim($stdout); +is($stdout,'t',"Check: temp_blk_read_time should not be 0."); + +($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); +trim($stdout); +is($stdout,'t',"Check: temp_blk_write_time should not be 0."); # DROP EXTENSION $stdout = $node->safe_psql('postgres', 'DROP EXTENSION pg_stat_monitor;', extra_params => ['-a']);