Skip to content

Commit 4e3d9b2

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Implement flaky test section
2 parents ac3ff5b + 849fdca commit 4e3d9b2

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
@@ -2626,7 +2626,7 @@ function run_test(string $php, $file, array $env): string
26262626

26272627
$wanted_re = null;
26282628
}
2629-
if (!$passed && !$retried && $retriable && error_may_be_retried($output)) {
2629+
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
26302630
$retried = true;
26312631
goto retry;
26322632
}
@@ -2806,9 +2806,10 @@ function run_test(string $php, $file, array $env): string
28062806
return $restype[0] . 'ED';
28072807
}
28082808

2809-
function error_may_be_retried(string $output): bool
2809+
function error_may_be_retried(TestFile $test, string $output): bool
28102810
{
2811-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1;
2811+
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2812+
|| $test->hasSection('FLAKY');
28122813
}
28132814

28142815
/**
@@ -3798,6 +3799,7 @@ class TestFile
37983799
'INI', 'ENV', 'EXTENSIONS',
37993800
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN',
38003801
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE',
3802+
'FLAKY',
38013803
];
38023804

38033805
/**

0 commit comments

Comments
 (0)