1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-25 20:44:01 +01:00

Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/12996] Fix reliability issue in flock test.
This commit is contained in:
Andreas Fischer 2014-08-19 12:20:07 +02:00
commit e9347ec839

View File

@ -83,9 +83,9 @@ class phpbb_lock_flock_test extends phpbb_test_case
sleep(1);
$lock = new \phpbb\lock\flock($path);
$start = time();
$start = microtime(true);
$ok = $lock->acquire();
$delta = time() - $start;
$delta = microtime(true) - $start;
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());
$this->assertGreaterThan(0.5, $delta, 'First lock acquired too soon');
@ -94,9 +94,9 @@ class phpbb_lock_flock_test extends phpbb_test_case
$this->assertFalse($lock->owns_lock());
// acquire again, this should be instantaneous
$start = time();
$start = microtime(true);
$ok = $lock->acquire();
$delta = time() - $start;
$delta = microtime(true) - $start;
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());
$this->assertLessThan(0.1, $delta, 'Second lock not acquired instantaneously');