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:
parent
a78ddc6ca8
commit
b212d00735
@ -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()
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user