Skip to content

Commit a1a340f

Browse files
committed
Add some dummy tests to check all pg_wait_sampling functions
1 parent 4c7549e commit a1a340f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Diff for: expected/queries.out

+19
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
--------------------------------

Diff for: sql/queries.sql

+4
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 t as (SELECT sum(0) FROM pg_wait_sampling_profile)
1010
SELECT sum(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+
SELECT count(*) = 1 as test FROM pg_wait_sampling_get_current(pg_backend_pid());
14+
SELECT count(*) > 5 as test FROM pg_wait_sampling_get_profile();
15+
SELECT count(*) > 100 as test FROM pg_wait_sampling_get_history();
1216
SELECT pg_wait_sampling_reset_profile();
1317

1418
DROP EXTENSION pg_wait_sampling;

0 commit comments

Comments
 (0)