mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
PG-563: Update TAP testcases and output due to changes by DEV.
As part of this PR, also updated regression test cases that are related to following JIRA issues as well. PG-354 pg_stat_monitor: Remove pg_stat_monitor_settings view Now we not using pg_stat_monitor_settings view, due to this change majority of TAP testcase requried output changes. PG-558: Create test case to verify the function names and count in PGSM. Added additional output file for SQL test case. PG-554: Remove redundant expected output files from regression. Removed unnecessary output files in TAP testcases where these were not needed.
This commit is contained in:
@@ -5,22 +5,22 @@
|
||||
# Before the fix, there were scenarios in which pg_stat_monitor could lose
|
||||
# queries (thus wrong call count/stats) when transitioning to a new bucket.
|
||||
#
|
||||
# The problem before the fix is described below:
|
||||
# The problem before the fix is DESCribed below:
|
||||
# 1. Say current active bucket number is 1.
|
||||
# 2. QueryID XYZ has call count (calls) = 4.
|
||||
# 3. QueryID also has a pending query (not yet finished).
|
||||
# 4. Bucket 1 timer expires, pg_stat_monitor moves to bucket 2.
|
||||
# 5. pg_stat_monitor moves only the pending QueryID XYZ to bucket 2.
|
||||
# 6. Remove QueryID XYZ from bucket 1 (all stats, calls=4, etc..).
|
||||
# 6. Remove QueryID XYZ FROM bucket 1 (all stats, calls=4, etc..).
|
||||
#
|
||||
# Since only the pending QueryID XYZ was moved to bucket 2, all
|
||||
# previous statistics for the same QueryID would have been incorrectly
|
||||
# removed from the previous bucket (1).
|
||||
# removed FROM the previous bucket (1).
|
||||
#
|
||||
# PG-291 fixes the problem, by keeping finished queries in the previous bucket
|
||||
# and moving only the pending query to the new bucket.
|
||||
#
|
||||
# This test works as follows:
|
||||
# This test works AS follows:
|
||||
# 1. Set pg_stat_monitor bucket time to 14 seconds.
|
||||
# 2. Start PostgreSQL, reset pg_stat_monitor view.
|
||||
# 3. Execute "SELECT pg_sleep(5)" three times in a row.
|
||||
@@ -39,10 +39,10 @@ use Test::More;
|
||||
use lib 't';
|
||||
use pgsm;
|
||||
|
||||
# Get filename and create out file name and dirs where requried
|
||||
# Get file name and CREATE out file name and dirs WHERE requried
|
||||
PGSM::setup_files_dir(basename($0));
|
||||
|
||||
# Create new PostgreSQL node and do initdb
|
||||
# CREATE new PostgreSQL node and do initdb
|
||||
my $node = PGSM->pgsm_init_pg();
|
||||
my $pgdata = $node->data_dir;
|
||||
|
||||
@@ -55,10 +55,10 @@ my $rt_value = $node->start;
|
||||
ok($rt_value == 1, "Start Server");
|
||||
|
||||
my ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'CREATE EXTENSION pg_stat_monitor;', extra_params => ['-a']);
|
||||
ok($cmdret == 0, "Create PGSM Extension");
|
||||
ok($cmdret == 0, "CREATE PGSM EXTENSION");
|
||||
|
||||
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT pg_stat_monitor_reset();', extra_params => ['-a', '-Pformat=aligned','-Ptuples_only=off']);
|
||||
ok($cmdret == 0, "Reset PGSM Extension");
|
||||
ok($cmdret == 0, "Reset PGSM EXTENSION");
|
||||
|
||||
($cmdret, $stdout, $stderr) = $node->psql('postgres', "SELECT pg_sleep(5)");
|
||||
ok($cmdret == 0, "1 - SELECT pg_sleep(5)");
|
||||
|
||||
Reference in New Issue
Block a user