Skip to content

Commit 849fdca

Browse files
committed
Implement flaky test section
This re-uses the already used for automatic retesting. That's certainly better than XFAIL. Closes GH-11325
1 parent 84a2e48 commit 849fdca

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

27482748
$wanted_re = null;
27492749
}
2750-
if (!$passed && !$retried && $retriable && error_may_be_retried($output)) {
2750+
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
27512751
$retried = true;
27522752
goto retry;
27532753
}
@@ -2875,9 +2875,10 @@ function run_test(string $php, $file, array $env): string
28752875
return $restype[0] . 'ED';
28762876
}
28772877

2878-
function error_may_be_retried(string $output): bool
2878+
function error_may_be_retried(TestFile $test, string $output): bool
28792879
{
2880-
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1;
2880+
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
2881+
|| $test->hasSection('FLAKY');
28812882
}
28822883

28832884
/**
@@ -3861,6 +3862,7 @@ class TestFile
38613862
'INI', 'ENV', 'EXTENSIONS',
38623863
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN',
38633864
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE',
3865+
'FLAKY',
38643866
];
38653867

38663868
/**

0 commit comments

Comments
 (0)