Skip to content

Commit 52535ba

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Retry tests on deadlock
2 parents 4a06c1d + ed92736 commit 52535ba

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

run-tests.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -2851,9 +2851,23 @@ function is_flaky(TestFile $test): bool
28512851
return preg_match($regex, $file) === 1;
28522852
}
28532853

2854+
function is_flaky_output(string $output): bool
2855+
{
2856+
$messages = [
2857+
'404: page not found',
2858+
'address already in use',
2859+
'connection refused',
2860+
'deadlock',
2861+
'mailbox already exists',
2862+
'timed out',
2863+
];
2864+
$regex = '(\b(' . implode('|', $messages) . ')\b)i';
2865+
return preg_match($regex, $output) === 1;
2866+
}
2867+
28542868
function error_may_be_retried(TestFile $test, string $output): bool
28552869
{
2856-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2870+
return is_flaky_output($output)
28572871
|| is_flaky($test);
28582872
}
28592873

0 commit comments

Comments
 (0)