1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.2'

* PHP-8.2:
  Implement flaky test section
This commit is contained in:
Ilija Tovilo
2023-07-06 09:46:15 +02:00
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
--TEST--
Test hrtime() aligns with microtime()
--XFAIL--
--FLAKY--
This test frequently fails in CI
--FILE--
<?php

View File

@@ -2650,7 +2650,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;
}
@@ -2832,9 +2832,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');
}
function expectf_to_regex(?string $wanted): string
@@ -3727,6 +3728,7 @@ class TestFile
'INI', 'ENV', 'EXTENSIONS',
'SKIPIF', 'XFAIL', 'XLEAK', 'CLEAN',
'CREDITS', 'DESCRIPTION', 'CONFLICTS', 'WHITESPACE_SENSITIVE',
'FLAKY',
];
/**