Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Retry tests on deadlock
This commit is contained in:
Ilija Tovilo 2023-11-16 16:02:58 +01:00
commit ed927365c2
No known key found for this signature in database
GPG Key ID: A4F5D403F118200A

View File

@ -2853,9 +2853,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);
}