1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 05:51:14 +01:00

Fix timing in sync tests

This commit is contained in:
coderstephen 2015-08-31 14:00:07 -05:00
parent a78ddc6ca8
commit b212d00735
3 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ class PosixSemaphoreTest extends TestCase
public function testAcquireMultiple()
{
$this->assertRunTimeBetween(function () {
$this->assertRunTimeGreaterThan(function () {
$semaphore = new PosixSemaphore(1);
Coroutine\create(function () use ($semaphore) {
@ -72,7 +72,7 @@ class PosixSemaphoreTest extends TestCase
Loop\run();
$semaphore->free();
}, 1.5, 1.65);
}, 1.5);
}
public function tesCloneIsSameSemaphore()

View File

@ -28,7 +28,7 @@ class MutexTest extends TestCase
{
Loop\loop();
$this->assertRunTimeBetween(function () {
$this->assertRunTimeGreaterThan(function () {
Coroutine\create(function () {
$mutex = new Mutex();
@ -49,6 +49,6 @@ class MutexTest extends TestCase
});
Loop\run();
}, 1.5, 1.65);
}, 1.5);
}
}

View File

@ -34,7 +34,7 @@ class SemaphoreTest extends TestCase
{
Loop\loop();
$this->assertRunTimeBetween(function () {
$this->assertRunTimeGreaterThan(function () {
Coroutine\create(function () {
$semaphore = new Semaphore(1);
@ -55,6 +55,6 @@ class SemaphoreTest extends TestCase
});
Loop\run();
}, 1.5, 1.75);
}, 1.5);
}
}