CRM_Mailing_BAO_Mailing::processQueue - Allow tests to prolong the critical section
authorTim Otten <totten@civicrm.org>
Tue, 12 May 2015 04:02:33 +0000 (21:02 -0700)
committerTim Otten <totten@civicrm.org>
Mon, 15 Jun 2015 17:34:03 +0000 (10:34 -0700)
CRM/Mailing/BAO/Mailing.php

index d37b75a1884e3d7b264a63167e3670337c60b819..df4329f44f8302585cc0119fb4454bf4b1a6ebe3 100644 (file)
@@ -2928,6 +2928,11 @@ WHERE  civicrm_mailing_job.id = %1
         CRM_Core_Error::debug_log_message('Returning early, since max number of cronjobs running');
         return TRUE;
       }
+
+      if (getenv('CIVICRM_CRON_HOLD')) {
+        // In testing, we may need to simulate some slow activities.
+        sleep(getenv('CIVICRM_CRON_HOLD'));
+      }
     }
 
     // load bootstrap to call hooks