public function testClearPoolSync() { $this->redis->zadd('test', [1 => self::TIME_MOCK - 10, 3 => self::TIME_MOCK - 5, 5 => self::TIME_MOCK - 2 + 600.1, 7 => self::TIME_MOCK + 600.1, 9 => self::TIME_MOCK + 5]); $pool = new Pool($this->redis, 'test', [Base::OPT_SLAVES_SYNC_ENABLED => true, Base::OPT_SLAVES_SYNC_REQUIRED_COUNT => 5], $this->getTimeMock()); try { $pool->clearPool(); } catch (\PhpRQ\Exception\NotEnoughSlavesSynced $e) { } $this->assertKeys([]); }
public function testClearPool() { $time = time(); $this->redis->zadd('test', [1 => $time - 10, 3 => $time - 5, 5 => $time - 2 + 600.1, 7 => $time + 600.1, 9 => $time + 5]); $pool = new Pool($this->redis, 'test'); $pool->clearPool(); $this->assertKeys([]); }
public function testClearPool() { $this->redis->zadd('test', [1 => self::TIME_MOCK - 10, 3 => self::TIME_MOCK - 5, 5 => self::TIME_MOCK - 2 + 600.1, 7 => self::TIME_MOCK + 600.1, 9 => self::TIME_MOCK + 5]); $pool = new Pool($this->redis, 'test', [], $this->getTimeMock()); $pool->clearPool(); $this->assertKeys([]); }