Skip to content

Commit

Permalink
Make unrepeatable tests retriable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iluuu1994 committed Aug 29, 2023
1 parent bf3fb4e commit f2c16b7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions run-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,6 @@ function run_test(string $php, $file, array $env): string
$skipCache = new SkipCache($enableSkipCache, $cfg['keep']['skip']);
}

$retriable = true;
$retried = false;
retry:

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

if ($test->hasSection('FILE_EXTERNAL')) {
$retriable = false;
if ($num_repeats > 1) {
return skip_test($tested, $tested_file, $shortname, 'Test with FILE_EXTERNAL might not be repeatable');
}
Expand Down Expand Up @@ -1964,7 +1962,6 @@ function run_test(string $php, $file, array $env): string
}
$php = $php_cgi . ' -C ';
$uses_cgi = true;
$retriable = false;
if ($num_repeats > 1) {
return skip_test($tested, $tested_file, $shortname, 'CGI does not support --repeat');
}
Expand All @@ -1982,15 +1979,13 @@ function run_test(string $php, $file, array $env): string
} else {
return skip_test($tested, $tested_file, $shortname, 'phpdbg not available');
}
$retriable = false;
if ($num_repeats > 1) {
return skip_test($tested, $tested_file, $shortname, 'phpdbg does not support --repeat');
}
}

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

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

$wanted_re = null;
}
if (!$passed && !$retried && $retriable && error_may_be_retried($test, $output)) {
if (!$passed && !$retried && error_may_be_retried($test, $output)) {
$retried = true;
goto retry;
}
Expand Down

0 comments on commit f2c16b7

Please sign in to comment.