Skip to content

Commit df86c7b

Browse files
committed
fixed tests for HHVM, fixes #24
1 parent 780d147 commit df86c7b

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ php:
77
- 7.0
88
- hhvm
99

10-
matrix:
11-
allow_failures:
12-
- php: hhvm
13-
fast_finish: true
14-
1510
install: ./travis-init.sh
1611

1712
script:

tests/AbstractLoopTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function runShouldReturnWhenNoMoreFds()
173173

174174
$this->writeToStream($input, "foo\n");
175175

176-
$this->assertRunFasterThan(0.005);
176+
$this->assertRunFasterThan(0.015);
177177
}
178178

179179
/** @test */
@@ -191,7 +191,7 @@ public function stopShouldStopRunningLoop()
191191
$this->assertRunFasterThan(0.005);
192192
}
193193

194-
public function testStopShouldPreventRunFromBlocking()
194+
public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005)
195195
{
196196
$this->loop->addTimer(
197197
1,
@@ -206,7 +206,7 @@ function () {
206206
}
207207
);
208208

209-
$this->assertRunFasterThan(0.005);
209+
$this->assertRunFasterThan($timeLimit);
210210
}
211211

212212
public function testIgnoreRemovedCallback()

tests/StreamSelectLoopTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,15 @@ public function testStreamSelectTimeoutEmulation()
2727

2828
$this->assertGreaterThan(0.04, $interval);
2929
}
30+
31+
public function testStopShouldPreventRunFromBlocking($timeLimit = 0.005)
32+
{
33+
if (defined('HHVM_VERSION')) {
34+
// HHVM is a bit slow, so give it more time
35+
parent::testStopShouldPreventRunFromBlocking(0.5);
36+
} else {
37+
parent::testStopShouldPreventRunFromBlocking($timeLimit);
38+
}
39+
}
40+
3041
}

0 commit comments

Comments
 (0)