Skip to content

Commit f2c16b7

Browse files
committed
Make unrepeatable tests retriable
This was an error in thinking on my side. The reason these tests are unrepeatable is because --repeat executes the same request in the same process, and does not run the CLEAN section in between runs. This is not the case when retrying tests. We could potentially make CLEAN tests repeatable by including the CLEAN section in the tested script. This does however not work for all tests (e.g. tests that set open_basedir). Closes GH-12072
1 parent bf3fb4e commit f2c16b7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

run-tests.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,6 @@ function run_test(string $php, $file, array $env): string
18861886
$skipCache = new SkipCache($enableSkipCache, $cfg['keep']['skip']);
18871887
}
18881888

1889-
$retriable = true;
18901889
$retried = false;
18911890
retry:
18921891

@@ -1935,7 +1934,6 @@ function run_test(string $php, $file, array $env): string
19351934
$tested = $test->getName();
19361935

19371936
if ($test->hasSection('FILE_EXTERNAL')) {
1938-
$retriable = false;
19391937
if ($num_repeats > 1) {
19401938
return skip_test($tested, $tested_file, $shortname, 'Test with FILE_EXTERNAL might not be repeatable');
19411939
}
@@ -1964,7 +1962,6 @@ function run_test(string $php, $file, array $env): string
19641962
}
19651963
$php = $php_cgi . ' -C ';
19661964
$uses_cgi = true;
1967-
$retriable = false;
19681965
if ($num_repeats > 1) {
19691966
return skip_test($tested, $tested_file, $shortname, 'CGI does not support --repeat');
19701967
}
@@ -1982,15 +1979,13 @@ function run_test(string $php, $file, array $env): string
19821979
} else {
19831980
return skip_test($tested, $tested_file, $shortname, 'phpdbg not available');
19841981
}
1985-
$retriable = false;
19861982
if ($num_repeats > 1) {
19871983
return skip_test($tested, $tested_file, $shortname, 'phpdbg does not support --repeat');
19881984
}
19891985
}
19901986

19911987
foreach (['CLEAN', 'STDIN', 'CAPTURE_STDIO'] as $section) {
19921988
if ($test->hasSection($section)) {
1993-
$retriable = false;
19941989
if ($num_repeats > 1) {
19951990
return skip_test($tested, $tested_file, $shortname, "Test with $section might not be repeatable");
19961991
}
@@ -2173,7 +2168,6 @@ function run_test(string $php, $file, array $env): string
21732168
settings2array(preg_split("/[\n\r]+/", $ini), $ini_settings);
21742169

21752170
if (isset($ini_settings['opcache.opt_debug_level'])) {
2176-
$retriable = false;
21772171
if ($num_repeats > 1) {
21782172
return skip_test($tested, $tested_file, $shortname, 'opt_debug_level tests are not repeatable');
21792173
}
@@ -2747,7 +2741,7 @@ function run_test(string $php, $file, array $env): string
27472741

27482742
$wanted_re = null;
27492743
}
2750-
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
2744+
if (!$passed && !$retried && error_may_be_retried($test, $output)) {
27512745
$retried = true;
27522746
goto retry;
27532747
}

0 commit comments

Comments
 (0)