Skip to content

Commit 58712e0

Browse files
committed
Retry tests on deadlock
Closes phpGH-12693
1 parent a742010 commit 58712e0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

run-tests.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2824,9 +2824,23 @@ function is_flaky(TestFile $test): bool
28242824
return preg_match($regex, $file) === 1;
28252825
}
28262826

2827+
function is_flaky_output(string $output): bool
2828+
{
2829+
$messages = [
2830+
'404: page not found',
2831+
'address already in use',
2832+
'connection refused',
2833+
'deadlock',
2834+
'mailbox already exists',
2835+
'timed out',
2836+
];
2837+
$regex = '(\b(' . implode('|', $messages) . ')\b)i';
2838+
return preg_match($regex, $output) === 1;
2839+
}
2840+
28272841
function error_may_be_retried(TestFile $test, string $output): bool
28282842
{
2829-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2843+
return is_flaky_output($output)
28302844
|| is_flaky($test);
28312845
}
28322846

0 commit comments

Comments
 (0)