From: Tim Otten Date: Mon, 15 Jun 2015 19:48:56 +0000 (-0700) Subject: CRM-16387 - JobProcessMailingTest - Add comments about brokenness of mailerJobsMax... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a2341a99e0c77d4ddcc7eeb9ccf69b461c8a0e3f;p=civicrm-core.git CRM-16387 - JobProcessMailingTest - Add comments about brokenness of mailerJobsMax/lockHold With the current MySQL-based lock-implementation, mailerJobsMax cannot be enforced because the job locks (```data.mailing.job.*```) trample the worker locks (```worker.mailing.*```). The relevant tests are hacked (```lockHold```) so that they pass and loosely approximate what *would* happen if the lock implementation were less bonkers. --- diff --git a/tests/phpunit/api/v3/JobProcessMailingTest.php b/tests/phpunit/api/v3/JobProcessMailingTest.php index bab19dedab..fd90e15972 100644 --- a/tests/phpunit/api/v3/JobProcessMailingTest.php +++ b/tests/phpunit/api/v3/JobProcessMailingTest.php @@ -116,6 +116,10 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { array( 'recipients' => 20, 'workers' => 3, + // FIXME: lockHold is unrealistic/unrepresentative. In reality, this situation fails because + // the data.* locks trample the worker.* locks. However, setting lockHold allows us to + // approximate the behavior of what would happen *if* the lock-implementation didn't suffer + // trampling effects. 'lockHold' => 10, 'mailerBatchLimit' => 4, 'mailerJobsMax' => 1, @@ -132,6 +136,10 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { array(// Settings. 'recipients' => 20, 'workers' => 3, + // FIXME: lockHold is unrealistic/unrepresentative. In reality, this situation fails because + // the data.* locks trample the worker.* locks. However, setting lockHold allows us to + // approximate the behavior of what would happen *if* the lock-implementation didn't suffer + // trampling effects. 'lockHold' => 10, 'mailerBatchLimit' => 5, 'mailerJobsMax' => 2, @@ -148,7 +156,6 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { array(// Settings. 'recipients' => 20, 'workers' => 3, - 'lockHold' => 10, 'mailerBatchLimit' => 6, 'mailerJobsMax' => 3, ), @@ -163,7 +170,6 @@ class api_v3_JobProcessMailingTest extends CiviUnitTestCase { array(// Settings. 'recipients' => 20, 'workers' => 4, - 'lockHold' => 4, 'mailerBatchLimit' => 6, 'mailerJobsMax' => 0, ),