diff --git a/src/postgres/src/test/isolation/expected/yb.port.async-notify.out b/src/postgres/src/test/isolation/expected/yb.port.async-notify.out index ff75441dd7b7..298b7e29eda3 100644 --- a/src/postgres/src/test/isolation/expected/yb.port.async-notify.out +++ b/src/postgres/src/test/isolation/expected/yb.port.async-notify.out @@ -104,10 +104,10 @@ step l2commit: COMMIT; listener2: NOTIFY "c1" with payload "" from notifier step l2stop: UNLISTEN *; -starting permutation: llisten lbegin usage bignotify usage +starting permutation: llisten lbegin yb_lusage bignotify yb_empty yb_lusage step llisten: LISTEN c1; LISTEN c2; step lbegin: BEGIN; -step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero; +step yb_lusage: SELECT pg_notification_queue_usage() > 0 AS nonzero; nonzero ------- f @@ -120,7 +120,8 @@ count 1000 (1 row) -step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero; +step yb_empty: +step yb_lusage: SELECT pg_notification_queue_usage() > 0 AS nonzero; nonzero ------- t diff --git a/src/postgres/src/test/isolation/specs/yb.port.async-notify.spec b/src/postgres/src/test/isolation/specs/yb.port.async-notify.spec index c821b6e5bd60..760c3d1f0f99 100644 --- a/src/postgres/src/test/isolation/specs/yb.port.async-notify.spec +++ b/src/postgres/src/test/isolation/specs/yb.port.async-notify.spec @@ -31,8 +31,8 @@ step notifys1 { ROLLBACK TO SAVEPOINT s2; COMMIT; } -step usage { SELECT pg_notification_queue_usage() > 0 AS nonzero; } step bignotify { SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s; } +step yb_empty {} teardown { UNLISTEN *; } # The listener session is used for cross-backend notify checks. @@ -43,6 +43,7 @@ step lcheck { SELECT 1 AS x; } step lbegin { BEGIN; } step lbegins { BEGIN ISOLATION LEVEL SERIALIZABLE; } step lcommit { COMMIT; } +step yb_lusage { SELECT pg_notification_queue_usage() > 0 AS nonzero; } teardown { UNLISTEN *; } # In some tests we need a second listener, just to block the queue. @@ -81,10 +82,14 @@ permutation l2listen l2begin notify1 lbegins llisten lcommit l2commit l2stop # commit the listener's transaction, so that it never reports these events. # Hence, this should be the last test in this script. -# YB: In YB, any operation taking longer than +# YB: +# In YB, any operation taking longer than # YB_NUM_SECONDS_TO_WAIT_TO_ASSUME_SESSION_BLOCKED is deemed as waiting on the # other session. The step 'bignotify' intermittently breaches this limit. To # make the output deterministic, add (*) to bignotify to always report it as # waiting. +# +# Also, in YB, listener and notifier can be in different nodes. Check queue +# usage on the listening node after bignotify completes. -permutation llisten lbegin usage bignotify(*) usage +permutation llisten lbegin yb_lusage bignotify(*) yb_empty yb_lusage