You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by yj...@apache.org on 2025/01/14 12:39:57 UTC

(cloudberry) 10/22: resqueue test: Close holdable cursor instead

This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit cfed4db998493ee61153fcfef180bf6ea3f8814c
Author: Soumyadeep Chakraborty <so...@gmail.com>
AuthorDate: Wed Jun 28 12:43:20 2023 -0700

    resqueue test: Close holdable cursor instead
    
    Quitting the session is non-blocking and can cause diffs like:
    
     -- Sanity check: Ensure that all locks were released.
     0:SELECT granted, locktype, mode FROM pg_locks where locktype = 'resource queue' and pid != pg_backend_pid();
    - granted | locktype | mode
    ----------+----------+------
    -(0 rows)
    + granted | locktype       | mode
    +---------+----------------+---------------
    + t       | resource queue | ExclusiveLock
    +(1 row)
    
     -- Sanity check: Ensure that the resource queue is now empty.
     0: SELECT rsqcountlimit, rsqcountvalue from pg_resqueue_status WHERE rsqname = 'rq_concurrency_test';
    
    CLOSE the cursor instead, which will be a blocking operation, and will
    exercise the same code path.
    
    Co-authored-by: Jimmy Yih <jy...@vmware.com>
---
 src/test/isolation2/expected/resource_queue.out | 3 ++-
 src/test/isolation2/sql/resource_queue.sql      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test/isolation2/expected/resource_queue.out b/src/test/isolation2/expected/resource_queue.out
index 05c4d2c429..f52c6890dd 100644
--- a/src/test/isolation2/expected/resource_queue.out
+++ b/src/test/isolation2/expected/resource_queue.out
@@ -99,7 +99,8 @@ DECLARE
  t       | resource queue | ExclusiveLock 
 (1 row)
 
-4q: ... <quitting>
+4:CLOSE c_hold;
+CLOSE
 
 -- Sanity check: Ensure that all locks were released.
 0:SELECT granted, locktype, mode FROM pg_locks where locktype = 'resource queue' and pid != pg_backend_pid();
diff --git a/src/test/isolation2/sql/resource_queue.sql b/src/test/isolation2/sql/resource_queue.sql
index 1523ada116..8f4280ea7d 100644
--- a/src/test/isolation2/sql/resource_queue.sql
+++ b/src/test/isolation2/sql/resource_queue.sql
@@ -47,7 +47,7 @@
 -- Sanity check: The holdable cursor should be accounted for in pg_locks.
 0:SELECT granted, locktype, mode FROM pg_locks where locktype = 'resource queue' and pid != pg_backend_pid();
 
-4q:
+4:CLOSE c_hold;
 
 -- Sanity check: Ensure that all locks were released.
 0:SELECT granted, locktype, mode FROM pg_locks where locktype = 'resource queue' and pid != pg_backend_pid();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org