Skip to content

Commit

Permalink
Increase margin of error for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Dec 7, 2024
1 parent 1f90197 commit b561666
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/pathological/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,12 @@
$timeout = 5; // 5 seconds
} else {
// Ideally, these cases should run in linear time or better,
// but we'll allow a 50% margin of error.
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 1.5);
// but we'll allow a 50% margin of error locally (or 2x in CI)
if (isset($_ENV['CI']) || isset($_SERVER['CI'])) {
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 2);
} else {
$timeout = \ceil($lastRunTime * $inputSize / $lastInputSize * 1.5);
}
// But regardless of this, we always want to wait at least 5 seconds,
// and at most 60 seconds.
$timeout = \max(5, \min(60, $timeout));
Expand Down

0 comments on commit b561666

Please sign in to comment.