[wp-trac] [WordPress Trac] #55919: Composer: Disable process timeout for PHPUnit tests
WordPress Trac
noreply at wordpress.org
Wed Sep 21 05:19:08 UTC 2022
#55919: Composer: Disable process timeout for PHPUnit tests
----------------------------------------+---------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.1
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-testing-info | Focuses:
----------------------------------------+---------------------
Changes (by ironprogrammer):
* keywords: has-patch => has-patch has-testing-info
Comment:
== Reproduction Report
I am able to force the reported error by setting Composer's `process-
timeout` value to less than the time expected to run the multisite unit
test suite (in my case, this takes ~2.5 minutes).
=== Environment
- Hardware: MacBook Pro Apple M1 Pro
- OS: macOS 12.6
- Server: nginx/1.23.1
- PHP: 7.4.30
- WordPress: 6.1-alpha-53344-src
=== Pre-Test Configuration
1. Set Composer's `process-timeout` to a low value (e.g. 10 seconds) to
simulate an insufficient timeout period: `export
COMPOSER_PROCESS_TIMEOUT=10`.
2. Confirm the `process-timeout` value with: `composer config process-
timeout`.
=== Actual Results
- ✅ Error occurs after ~10 seconds (per `process-timeout` override
above):
{{{
The following exception is caused by a process timeout
Check https://getcomposer.org/doc/06-config.md#process-timeout for details
In Process.php line 1204:
The process "'/opt/homebrew/Cellar/php at 7.4/7.4.30_1/bin/php' -d
allow_url_fopen='1' -d disable_
functions='' -d memory_limit='1536M' ./vendor/phpunit/phpunit/phpunit '
--verbose' '-c' 'tests/p
hpunit/multisite.xml'" exceeded the timeout of 10 seconds.
test [--dev] [--no-dev] [--] [<args>...]
Warning: Use --force to continue.
Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! WordPress at 6.1.0 grunt: `grunt "phpunit:multisite"`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the WordPress at 6.1.0 grunt script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /<redacted>/.npm/_logs/2022-09-21T05_06_59_646Z-debug.log
}}}
=== Additional Notes
- Bypassing Composer and running `phpunit --verbose -c
tests/phpunit/multisite.xml` directly will **not** reproduce the issue.
----
== Test Report
LGTM 👍🏻 As above, this can be tested by forcing an insufficient time
period to complete the test suite.
Patch tested:
https://core.trac.wordpress.org/attachment/ticket/55919/55919.diff
=== Pre-Test Configuration
1. Set Composer's `process-timeout` to a low value (e.g. 10 seconds) to
simulate an insufficient timeout period: `export
COMPOSER_PROCESS_TIMEOUT=10`.
2. Confirm the `process-timeout` value with: `composer config process-
timeout`.
=== Actual Results
- ✅ Patch update overrides `process-timeout` value and tests complete
without error.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55919#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list