private function assertNotQueueManagerIsLocked()
 {
     $this->assertFalse($this->lock->isLocked());
 }
 public function test_process_ShouldNotDirectlyProcessQueue_IfAlreadyLocked()
 {
     Queue\Factory::getSettings()->numQueueWorkers->setValue(1);
     $this->handler->enableProcessingInTrackerMode();
     $this->queue->setNumberOfRequestsToProcessAtSameTime(1);
     // there is only one worker, so make sure that queue is locked
     $lock = new Queue\Lock($this->backend);
     $lock->acquireLock(0);
     $this->assertSame(0, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->processDummyRequests();
     $this->assertSame(1, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->processDummyRequests();
     $this->assertSame(2, $this->queue->getNumberOfRequestSetsInAllQueues());
     $this->queue->unlock();
 }
 private function acquireAllQueueLocks()
 {
     for ($queueId = 0; $queueId < $this->queue->getNumberOfAvailableQueues(); $queueId++) {
         $this->lock->acquireLock($queueId);
     }
 }
 public function expireLock($ttlInSeconds)
 {
     return $this->lock->expireLock($ttlInSeconds);
 }
 private function assertNumberOfLocksEquals($numExpectedLocks)
 {
     $this->assertSame($numExpectedLocks, $this->lock->getNumberOfAcquiredLocks());
 }