On Mon, Apr 06, 2026 at 03:19:57PM +0900, Michael Paquier wrote:
> Now looking at it, and for the reason why 010 for concurrent indexes
> does not complain..

This one was a simple puzzle: there was a race condition between the
detach done by a local point and the wait/detach sequence.  As we want
a detach, dropping the local point is proving to work here.

I am going to do a few more runs to gain some more confidence.
Bertrand, could you confirm please?
--
Michael
From 684a26ad148a6d3d4261a633978702f76d7ee537 Mon Sep 17 00:00:00 2001
From: Michael Paquier <[email protected]>
Date: Mon, 6 Apr 2026 15:34:03 +0900
Subject: [PATCH] Fix detach timing problem in lock stats test

---
 src/test/modules/test_misc/t/011_lock_stats.pl | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/test/modules/test_misc/t/011_lock_stats.pl 
b/src/test/modules/test_misc/t/011_lock_stats.pl
index 58a0046a52c3..908ade55a05f 100644
--- a/src/test/modules/test_misc/t/011_lock_stats.pl
+++ b/src/test/modules/test_misc/t/011_lock_stats.pl
@@ -31,9 +31,8 @@ sub setup_sessions
        $s2 = $node->background_psql('postgres');
 
        # Setup injection points for the waiting session
-       $s2->query_safe(
-               q[
-                       SELECT injection_points_set_local();
+       $s2->query_until(qr/attaching_injection_point/, q[
+                       \echo attaching_injection_point
                        SELECT 
injection_points_attach('deadlock-timeout-fired', 'wait');
                ]);
 }
@@ -59,10 +58,11 @@ sub wait_and_detach
        my ($node, $point_name) = @_;
 
        $node->wait_for_event('client backend', $point_name);
-       $node->safe_psql('postgres',
-               "SELECT injection_points_detach('$point_name');");
-       $node->safe_psql('postgres',
-               "SELECT injection_points_wakeup('$point_name');");
+       $node->safe_psql(
+               'postgres', qq[
+SELECT injection_points_detach('$point_name');
+SELECT injection_points_wakeup('$point_name');
+]);
 }
 
 # Node initialization
-- 
2.53.0

Attachment: signature.asc
Description: PGP signature

Reply via email to