From bf4ebf9d00201a835b9c921620184f7aa499e2d1 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 17 Mar 2023 00:22:03 -0700 Subject: [PATCH] CiviUnitTestCase - During cleanup, ensure that we have a clean slate (wrt locking) --- tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 9930747914..0407a3725f 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -453,6 +453,8 @@ class CiviUnitTestCase extends PHPUnit\Framework\TestCase { $this->quickCleanup($tablesToTruncate); $this->createDomainContacts(); } + $releasedLocks = CRM_Core_DAO::singleValueQuery('SELECT RELEASE_ALL_LOCKS()'); + $this->assertEquals(0, $releasedLocks, "The test should not leave any dangling locks. Found $releasedLocks"); $this->cleanTempDirs(); $this->unsetExtensionSystem(); -- 2.25.1