Commit Graph

768 Commits

Author SHA1 Message Date
Ilija Tovilo
2312637496
Retry tests on deadlock
Closes GH-12693
2023-11-22 20:39:29 -06:00
Ilija Tovilo
9bdd0f0de9
Automatically mark tests as flaky
Marking all of these tests as flaky is annoying, so attempt to recognize them
automatically.

Closes GH-12638
2023-11-22 20:39:29 -06:00
Ilija Tovilo
f4a6a6d096
Increase run-tests.php timeout for asan
Closes GH-12087
2023-08-30 23:09:33 +02:00
Ilija Tovilo
f2c16b7ba3
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
2023-08-29 13:56:13 +02:00
Ilija Tovilo
849fdcae7d
Implement flaky test section
This re-uses the already used for automatic retesting. That's certainly better
than XFAIL.

Closes GH-11325
2023-07-06 09:45:35 +02:00
Ilija Tovilo
f249958cd3
[skip ci] Add more patterns to run-tests.php retry list
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
2023-05-27 19:21:19 +02:00
Ilija Tovilo
11597d18d6
Add retry mechanism in run-tests.php
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
2023-05-03 13:47:13 +02:00
Ilija Tovilo
471105abd7
Another attempt to fix MSAN nightly on master 2023-03-15 23:37:36 +01:00
Ilija Tovilo
63525ee600
use_tls=0 on MSAN
Attempt to fix MSAN failure in CI

Closes GH-10851
2023-03-14 17:42:23 +01:00
Arnaud Le Blanc
8c0698f66b
Fix run-tests.php hanging when a worker process dies without notice (#9931)
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)
2023-01-13 17:43:17 +01:00
Ilija Tovilo
ed1e703716
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Migrate i386 to GitHub actions
2022-11-03 14:37:17 +01:00
Ilija Tovilo
75970077b0
Migrate i386 to GitHub actions
Closes GH-9856
2022-11-03 14:34:54 +01:00
Christoph M. Becker
d430652935
Fix --CGI-- support of run-tests.php
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.
2022-07-20 14:41:28 +02:00
George Peter Banyard
c05c96b3fe Fix GH-8691 Add required extensions for redirected tests 2022-06-08 11:37:07 +01:00
Remi Collet
43dd512eb6
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  typo
2022-03-29 10:20:34 +02:00
Remi Collet
fe4aba6588
typo 2022-03-29 10:20:21 +02:00
Remi Collet
85533e741a
Merge branch 'PHP-8.0' into PHP-8.1
* 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]
2022-03-29 09:55:04 +02:00
Remi Collet
23cce68d24
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] 2022-03-29 09:54:40 +02:00
Christoph M. Becker
87d9e02f01
Don't truncate subsecond precision in run-tests.php JUNIT output
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.
2021-12-27 22:15:33 +01:00
Remi Collet
39e4ae0c04
[ci skip] typo 2021-10-12 13:39:24 +02:00
Remi Collet
ea00e6501c
Fix #81520 TEST_PHP_CGI_EXECUTABLE badly set in run-tests.php 2021-10-12 13:33:16 +02:00
Nikita Popov
9fc6be297f Add env var to disable skip cache
DISABLE_SKIP_CACHE=1 can be used to disable the skip cache. This
does not control the extensions cache.

See https://externals.io/message/116044 for related discussion.

Closes GH-7510.
2021-09-29 13:05:25 +02:00
Nikita Popov
1015eefffe Automatically skip ext/opcache tests under --preload
Also skip observer tests, as these will observe the additional
preload file inserted by the test runner.
2021-07-30 17:26:45 +02:00
Nikita Popov
1a370d3321 Skip some tests under --preload
A genuine problem here is that we sometime get different class
casing due interaction with the ZSTR CE cache. Ignore these for
now.
2021-07-30 17:26:39 +02:00
Nikita Popov
6aa08736bb Don't unlink preload file if test failed 2021-07-27 14:36:38 +02:00
Nikita Popov
bf40a933cd Add --bless option to run-tests.php
This runs bless_tests.php on all failed tests.
2021-07-16 14:39:47 +02:00
Nikita Popov
748568268a Make LDAPCONF test work on windows
Rather than using putenv(), use the ENV section. This also
required adding {PWD} support for it.
2021-06-14 10:40:18 +02:00
Nikita Popov
ea126c5204 Fix EXTENSIONS for cgi tests
The extension information needs to be fetched using the cli binary,
not the cgi binary.
2021-06-11 14:42:58 +02:00
Bob Weinand
0dbbf9ec47 Merge branch 'PHP-8.0' 2021-06-04 16:29:40 +02:00
Bob Weinand
c916613f13 Fix null handling in test runner when printing env 2021-06-04 16:29:14 +02:00
Bob Weinand
13d396bb59 Merge branch 'PHP-8.0' 2021-05-31 10:48:11 +02:00
Bob Weinand
76a4ea5e2a Export ENV in .sh file generated by run-tests 2021-05-31 10:47:14 +02:00
Nikita Popov
ea256a218b Add %0 format to run-tests.php
This format matches against null bytes, and prevents the test
expectation from being interpreted as binary data.

bless_tests.php will automatically replace \0 with %0 as well.
2021-05-29 11:33:13 +02:00
Christoph M. Becker
6f89da78d0
Adjust run-tests.php to dynamic extension loading
PR #6787 changed the behavior of the `--EXTENSIONS--` section, so that
not yet loaded extensions are dynamically loaded if possible.  However,
when no tests are specified for the runner, only tests for already
loaded extensions are run, what defeats the purpose of the improvement
of the `--EXTENSIONS--` behavior.  We cater to that by detecting
loadable extensions, and also run their tests.
2021-05-27 11:33:36 +02:00
Nikita Popov
b8e4d9f387 Use shell-free proc_open() in parallel run-tests.php 2021-05-19 20:46:50 +02:00
Michael Voříšek
3ccc0409ce Remove no longer used "log_errors_max_len" ini directive (#6838)
This is a re-application of the original match against master.
The patch was originally applied to master, then reverted from
there, incorrectly applied to PHP-8.0, reverted from there due
to ABI break, and now lands on master again. We can only hope
that it does not get reverted again ;)
2021-05-10 19:26:33 +02:00
Nikita Popov
090627048c Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit d2d227e547.

This is an ABI break.
2021-05-08 20:54:53 +02:00
Ben Ramsey
b5d5d06ff3
Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit cc2c810dcf.
2021-05-08 13:23:58 -05:00
Michael Voříšek
d2d227e547
Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-08 13:05:13 -05:00
Michael Voříšek
cc2c810dcf
Remove no longer used "log_errors_max_len" ini directive (#6838) 2021-05-07 19:07:35 -05:00
Mark Gallagher
39876ba1c6 run-tests: Fix warning when specifying xdebug as a required extension 2021-04-25 22:07:00 +02:00
Max Semenik
bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00
Nuno Maduro
e44f610443 Removes 'Parallel Edition' output in tests
Closes GH-6806.
2021-03-29 00:49:40 +02:00
Max Semenik
6c9a05667b run-tests: use the EXTENSIONS section for skipping
Currently, most skip checks are just for making sure an extension is
available. Even with recent addition of skip caching, this makes tests
needlessly slow:
* Checks for the same extension in its tests can have small differences
  impacting cacheability.
* Even identical skip checks in two tests can still be executed twice if
  they're run by different workers.

To remedy this, I'm repurposing the existing --EXTENSIONS-- section of
.phpt files to specify wjich extensions are required for current test to
run. Current behavior:
1) If the extension is already visible to PHP, all is good
2) If it isn't, assume it's present as a shared module and attempt to add
   it via a command line parameter
3) If that works, all is good
4) If it doesn't, PHP fails with a cryptic error message trying to
   execute the test itself

After this commit:
1) and 2) are kept unchanged
3) Check if shared extension file from 2) is actually present
4) Skip the test if it isn't

Other benefits include clear skip reasons (vs. sometimes none in many
current skip checks) and moving test information from code to metadata,
opening more opportunities for search and analysis.

Since --EXTENSIONS-- is barely ever used, this change poses no risk of
hidden failures.

As a demonstration of the new approach, this commit migrates one
extension to it. If merged, I will migrate other extensions in
subsequent PRs.

Closes GH-6787.
2021-03-22 09:53:38 +01:00
Max Semenik
9140c9038a run-tests.php: class for test file loading
This moves a bunch of code outside of run_tests(), making it a bit
more manageable. Additionally, accessors provide better readability
than isset() and friends.

This is a minimal patch that moves the code but does not refactor
much. For the sake of reviewing experience, it does not involve
further refactoring which could include:
* Removing setSection()
* Fixing up the mess with hasSection() vs. sectionNotEmpty(), only
  one of which is really needed.
* Moving more repetitive code into the new class.
All of this will be done with later commits.

Closes GH-6678.
2021-03-16 11:51:55 +01:00
Nikita Popov
0074a1d4e3 Make the nocache tag actually work
If nocache is used, then we should return an empty string result,
so the test doesn't get marked as borked.

Also limit to an occurrence at the start, just like other skip
tags.
2021-03-04 16:34:10 +01:00
Nikita Popov
4d43cbe333 Add mechanism to skip the skipif cache
If the SKIPIF section return nocache, don't cache the result. This
is used by tests that perform complex test set in conjunction with
skip checks, and need to be evaluated every time.
2021-03-04 16:28:11 +01:00
Nikita Popov
b853201a6d run-tests.php: Preserve .php on leak in one more place 2021-03-04 16:09:29 +01:00
Max Semenik
bdd7c48764 run-tests: drop support for ancient Valgrind versions
Valgrind 3.3.0 was released in 2007, not even RHEL has crap older than
this. It could be argued that 3.8.0, released in 2012, could be a safe
cutoff too.

Closes GH-6728.
2021-03-01 11:21:30 +01:00
Christoph M. Becker
51914610ab Merge branch 'PHP-8.0'
* PHP-8.0:
  Capture Microsoft-defined HRESULT exit codes exit codes
2021-02-25 12:05:27 +01:00