Skip to content

Commit b561666

Browse files
committed
Increase margin of error for CI
1 parent 1f90197 commit b561666

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/pathological/test.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,12 @@
300300
$timeout = 5; // 5 seconds
301301
} else {
302302
// Ideally, these cases should run in linear time or better,
303-
// but we'll allow a 50% margin of error.
304-
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 1.5);
303+
// but we'll allow a 50% margin of error locally (or 2x in CI)
304+
if (isset($_ENV['CI']) || isset($_SERVER['CI'])) {
305+
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 2);
306+
} else {
307+
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 1.5);
308+
}
305309
// But regardless of this, we always want to wait at least 5 seconds,
306310
// and at most 60 seconds.
307311
$timeout = \max(5, \min(60, $timeout));

0 commit comments

Comments
 (0)