Before
-----------------
If you run this test repeatedly, it may alternately pass and fail. The
percentage of passes-vs-fails can vary widely (depending on the computer
where you execute).
To test this, I went to a deployment (on `test-3`) which had a fairly
high probability of failure (*failure in roughly 3/4 invocations*).
After
-----------------
On the same system, it passes consistently (*no failures after 15 invocations*).
public function setUp(): void {
parent::setUp();
+
+ // Setup logging. This may create a series of backfilled log records.
$this->callAPISuccess('Setting', 'create', ['logging' => TRUE]);
$this->quickCleanup($this->_tablesToTruncate);
+
+ // The test needs to create+read some log records. We want this to have a new/separate `log_conn_id`.
+ unset(\Civi::$statics['CRM_Utils_Request']['id']);
+ CRM_Core_DAO::init(CIVICRM_DSN);
}
public function tearDown(): void {