Skip to content

Commit 2312637

Browse files
iluuu1994ramsey
authored andcommitted
Retry tests on deadlock
Closes GH-12693
1 parent e1e140f commit 2312637

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
@@ -2893,9 +2893,23 @@ function is_flaky(TestFile $test): bool
28932893
return preg_match($regex, $file) === 1;
28942894
}
28952895

2896+
function is_flaky_output(string $output): bool
2897+
{
2898+
$messages = [
2899+
'404: page not found',
2900+
'address already in use',
2901+
'connection refused',
2902+
'deadlock',
2903+
'mailbox already exists',
2904+
'timed out',
2905+
];
2906+
$regex = '(\b(' . implode('|', $messages) . ')\b)i';
2907+
return preg_match($regex, $output) === 1;
2908+
}
2909+
28962910
function error_may_be_retried(TestFile $test, string $output): bool
28972911
{
2898-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2912+
return is_flaky_output($output)
28992913
|| is_flaky($test);
29002914
}
29012915

0 commit comments

Comments
 (0)