Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1a340f

Browse files
committed
Add some dummy tests to check all pg_wait_sampling functions
1 parent4c7549e commita1a340f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎expected/queries.out

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,25 @@ WITH t as (SELECT sum(0) FROM pg_wait_sampling_profile)
2020
0
2121
(1 row)
2222

23+
-- Some dummy checks just to be sure that all our functions work and return something.
24+
SELECT count(*) = 1 as test FROM pg_wait_sampling_get_current(pg_backend_pid());
25+
test
26+
------
27+
t
28+
(1 row)
29+
30+
SELECT count(*) > 5 as test FROM pg_wait_sampling_get_profile();
31+
test
32+
------
33+
t
34+
(1 row)
35+
36+
SELECT count(*) > 100 as test FROM pg_wait_sampling_get_history();
37+
test
38+
------
39+
t
40+
(1 row)
41+
2342
SELECT pg_wait_sampling_reset_profile();
2443
pg_wait_sampling_reset_profile
2544
--------------------------------

‎sql/queries.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ WITH t as (SELECT sum(0) FROM pg_wait_sampling_history)
99
WITH tas (SELECTsum(0)FROM pg_wait_sampling_profile)
1010
SELECTsum(0)FROM generate_series(1,2), t;
1111

12+
-- Some dummy checks just to be sure that all our functions work and return something.
13+
SELECTcount(*)=1as testFROM pg_wait_sampling_get_current(pg_backend_pid());
14+
SELECTcount(*)>5as testFROM pg_wait_sampling_get_profile();
15+
SELECTcount(*)>100as testFROM pg_wait_sampling_get_history();
1216
SELECT pg_wait_sampling_reset_profile();
1317

1418
DROP EXTENSION pg_wait_sampling;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp