mirror of https://github.com/postgres/postgres
This tells you what fraction of NOTIFY's queue is currently filled. Brendan Jurd, reviewed by Merlin Moncure and Gurjeet Singh. A few further tweaks by me.pull/14/head
parent
43d89a23d5
commit
a04bb65f70
@ -0,0 +1,17 @@ |
||||
Parsed test spec with 2 sessions |
||||
|
||||
starting permutation: listen begin check notify check |
||||
step listen: LISTEN a; |
||||
step begin: BEGIN; |
||||
step check: SELECT pg_notification_queue_usage() > 0 AS nonzero; |
||||
nonzero |
||||
|
||||
f |
||||
step notify: SELECT count(pg_notify('a', s::text)) FROM generate_series(1, 1000) s; |
||||
count |
||||
|
||||
1000 |
||||
step check: SELECT pg_notification_queue_usage() > 0 AS nonzero; |
||||
nonzero |
||||
|
||||
t |
||||
@ -0,0 +1,14 @@ |
||||
# Verify that pg_notification_queue_usage correctly reports a non-zero result, |
||||
# after submitting notifications while another connection is listening for |
||||
# those notifications and waiting inside an active transaction. |
||||
|
||||
session "listener" |
||||
step "listen" { LISTEN a; } |
||||
step "begin" { BEGIN; } |
||||
teardown { ROLLBACK; } |
||||
|
||||
session "notifier" |
||||
step "check" { SELECT pg_notification_queue_usage() > 0 AS nonzero; } |
||||
step "notify" { SELECT count(pg_notify('a', s::text)) FROM generate_series(1, 1000) s; } |
||||
|
||||
permutation "listen" "begin" "check" "notify" "check" |
||||
Loading…
Reference in new issue