mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Implement flaky test section
This re-uses the already used for automatic retesting. That's certainly better than XFAIL. Closes GH-11325
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--TEST--
|
||||
Test hrtime() aligns with microtime()
|
||||
--XFAIL--
|
||||
--FLAKY--
|
||||
This test frequently fails in CI
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -2747,7 +2747,7 @@ COMMAND $cmd
|
||||
|
||||
$wanted_re = null;
|
||||
}
|
||||
if (!$passed && !$retried && $retriable && error_may_be_retried($output)) {
|
||||
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
|
||||
$retried = true;
|
||||
goto retry;
|
||||
}
|
||||
@@ -2875,9 +2875,10 @@ SH;
|
||||
return $restype[0] . 'ED';
|
||||
}
|
||||
|
||||
function error_may_be_retried(string $output): bool
|
||||
function error_may_be_retried(TestFile $test, string $output): bool
|
||||
{
|
||||
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1;
|
||||
return preg_match('((timed out)|(connection refused)|(404: page not found)|(address already in use)|(mailbox already exists))i', $output) === 1
|
||||
|| $test->hasSection('FLAKY');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3861,6 +3862,7 @@ class TestFile
|
||||
'INI', 'ENV', 'EXTENSIONS',
|
||||
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN',
|
||||
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE',
|
||||
'FLAKY',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user