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
CURL: 404: Page Not Found
IMAP: Can't create a temporary mailbox: [ALREADYEXISTS] Mailbox already exists
Sockets: socket_bind(): Unable to bind address [98]: Address already in use
We have lots of spurious failures in CI, many of them with the "all" CONFLICT.
We're limiting the retrying to specific error messages. In the future we may
also provide a FLAKY section to retry specific tests.
Closes GH-10892
run-tests.php with `-jN` can hang if a parallel worker dies without notice. This
can happen due to fatal errors in the worker, or if the worker is killed.
- run-tests.php (main process)
\_ run-tests.php (worker #0) // main process hangs if this one crashes
\_ test-001.php (test-001.phpt)
Makes the replacement easier to see, neatly aligned, and only takes one function call.
This is safe because none of the combined replacement values contain tokens that would be recursively replaced.
This also improves the readability on how the regular expressions in `EXPECTF` matcher is constructed.
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
The rationale is that `shell_exec()` is identical to the backtick operator (both of which are disabled when `shell_exec` function is disabled) makes it very clear that it is a shell execution, and eases security audits too.
Simplifies and improves the readability of multiple `if`/`elseif`/`else` blocks by removing them when an earlier branch exists the execution flow by either returning or terminating the script.
The `--CGI--` section is supposed to be just a marker, and to be empty
as such. However, a previous refactoring[1] broke that.
[1] <9140c9038a>
Closes GH-9061.
The $php_cgi and $phpdbg cases here are definitely real bugs, and
caused the script to bail out under certain ini settings.
The other paths may actually be unreachable in practice, but were
highlighted by PhpStorm.
* PHP-8.1:
run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n]
* PHP-8.0:
run-tests.php: fix TypeError: Unsupported operand types: string * int <n> is mandatory for --show-slow and --set-timeout use <n> in help message instead of confusing [n]
When run-tests.php has been typed[1], the type of `$time` has been
chosen to be `int`. This, however, leads to truncation, and the
somewhat relevant subsecond precision is lost. We fix that by
changing the type to `float`, although `int|string` would be more
appropriate, but requires PHP ≥ 7.4.0. Another option would be to
move the `number_format()` formatting into `junit_mark_test_as()`.
[1] <11274f53e7>
Closes GH-7836.
This is a tiny improvement to run-tests.php which helps keep it from
tripping over hidden files, including autosave files from various
editors, metadata on certain platforms, etc.
Closes GH-7783.