diff --git a/run-tests.php b/run-tests.php index 5fa65c355b4..16b74e5804a 100755 --- a/run-tests.php +++ b/run-tests.php @@ -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); }