From 12f2d014ac9a6ae351fa4a7b4140662807c7a0d4 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 15 Mar 2019 12:53:42 +1300 Subject: [PATCH] Attempt to improve false negatives on Logging test It might be significant that the one I added sleep(1) to before wasn't a fail in this one... https://test.civicrm.org/job/CiviCRM-Core-PR/25137/ --- tests/phpunit/api/v3/LoggingTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/phpunit/api/v3/LoggingTest.php b/tests/phpunit/api/v3/LoggingTest.php index 3d387038cf..eaa9fdb641 100644 --- a/tests/phpunit/api/v3/LoggingTest.php +++ b/tests/phpunit/api/v3/LoggingTest.php @@ -295,6 +295,9 @@ class api_v3_LoggingTest extends CiviUnitTestCase { public function testRevertNoDate() { $contactId = $this->individualCreate(); $this->callAPISuccess('Setting', 'create', array('logging' => TRUE)); + // Pause for one second here to ensure the timestamps between the first create action + // and the second differ. + sleep(1); CRM_Core_DAO::executeQuery("SET @uniqueID = 'Wot woot'"); $this->callAPISuccess('Contact', 'create', array( 'id' => $contactId, -- 2.25.1