mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Retry tests on deadlock
Closes GH-12693
This commit is contained in:
parent
a742010a0a
commit
58712e0698
@ -2824,9 +2824,23 @@ function is_flaky(TestFile $test): bool
|
||||
return preg_match($regex, $file) === 1;
|
||||
}
|
||||
|
||||
function is_flaky_output(string $output): bool
|
||||
{
|
||||
$messages = [
|
||||
'404: page not found',
|
||||
'address already in use',
|
||||
'connection refused',
|
||||
'deadlock',
|
||||
'mailbox already exists',
|
||||
'timed out',
|
||||
];
|
||||
$regex = '(\b(' . implode('|', $messages) . ')\b)i';
|
||||
return preg_match($regex, $output) === 1;
|
||||
}
|
||||
|
||||
function error_may_be_retried(TestFile $test, string $output): bool
|
||||
{
|
||||
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
|
||||
return is_flaky_output($output)
|
||||
|| is_flaky($test);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user