0001-Fix-detach-timing-problem-in-lock-stats-test.patch

text/plain

Filename: 0001-Fix-detach-timing-problem-in-lock-stats-test.patch
Type: text/plain
Part: 0
Message: Re: Adding locks statistics

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch 0001
Subject: Fix detach timing problem in lock stats test
File+
src/test/modules/test_misc/t/011_lock_stats.pl 7 7
From 684a26ad148a6d3d4261a633978702f76d7ee537 Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
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