Skip to content

Commit b0a2727

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Implement flaky test section
2 parents dbbcbcb + 4e3d9b2 commit b0a2727

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ext/standard/tests/hrtime/hrtime.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--TEST--
22
Test hrtime() aligns with microtime()
3-
--XFAIL--
3+
--FLAKY--
44
This test frequently fails in CI
55
--FILE--
66
<?php

run-tests.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,7 +2650,7 @@ function run_test(string $php, $file, array $env): string
26502650

26512651
$wanted_re = null;
26522652
}
2653-
if (!$passed && !$retried && $retriable && error_may_be_retried($output)) {
2653+
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
26542654
$retried = true;
26552655
goto retry;
26562656
}
@@ -2832,9 +2832,10 @@ function run_test(string $php, $file, array $env): string
28322832
return $restype[0] . 'ED';
28332833
}
28342834

2835-
function error_may_be_retried(string $output): bool
2835+
function error_may_be_retried(TestFile $test, string $output): bool
28362836
{
2837-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1;
2837+
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2838+
|| $test->hasSection('FLAKY');
28382839
}
28392840

28402841
function expectf_to_regex(?string $wanted): string
@@ -3727,6 +3728,7 @@ class TestFile
37273728
'INI', 'ENV', 'EXTENSIONS',
37283729
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN',
37293730
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE',
3731+
'FLAKY',
37303732
];
37313733

37323734
/**

0 commit comments

Comments
 (0)