From 00ebd2d7f25c521a10feae6c8217f6be0825f84d Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Thu, 13 Mar 2025 13:01:53 +0100 Subject: [PATCH] Fix flaky connection count in mysqli test Use connection ID instead of count to check whether we're using a persistent connection. This allows the test to be run in parallel with the other tests, but also protects against the possibility that some other service connects to the mysql server. Closes GH-18040 --- ext/mysqli/tests/bug73462.phpt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/mysqli/tests/bug73462.phpt b/ext/mysqli/tests/bug73462.phpt index c4d68ca4f59..318b8dd24b3 100644 --- a/ext/mysqli/tests/bug73462.phpt +++ b/ext/mysqli/tests/bug73462.phpt @@ -5,13 +5,6 @@ mysqli --SKIPIF-- --FILE-- query("SHOW STATUS LIKE 'Connections'"); + $result = $mysql_1->query("SELECT CONNECTION_ID()"); $c1 = $result->fetch_row(); $result->free(); $mysql_1->close(); @@ -35,7 +28,7 @@ if (gethostname() == "php-ci-ppc64be") { /* Re-use persistent connection */ $mysql_3 = new mysqli('p:'.$host, $user, $passwd, $db, $port); $error = mysqli_connect_errno(); - $result = $mysql_3->query("SHOW STATUS LIKE 'Connections'"); + $result = $mysql_3->query("SELECT CONNECTION_ID()"); $c3 = $result->fetch_row(); $result->free(); $mysql_3->close();