malkusch\lock\mutex\RedisMutexTest::testTimingOut PHP Method

testTimingOut() public method

Tests acquiring keys takes too long.
public testTimingOut ( integer $count, integer $timeout, integer $delay )
$count integer The total count of servers.
$timeout integer The timeout in seconds.
$delay integer The delay in microseconds.
    public function testTimingOut($count, $timeout, $delay)
    {
        $mutex = $this->buildRedisMutex($count, $timeout);
        $mutex->expects($this->any())->method("add")->willReturnCallback(function () use($delay) {
            usleep($delay);
            return true;
        });
        $mutex->synchronized(function () {
            $this->fail("Code should not be executed");
        });
    }