Skip to content

Commit ed92736

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Retry tests on deadlock
2 parents 3060edf + 58712e0 commit ed92736

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
@@ -2853,9 +2853,23 @@ function is_flaky(TestFile $test): bool
28532853
return preg_match($regex, $file) === 1;
28542854
}
28552855

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

0 commit comments

Comments
 (0)