test(ci): enforce PHPUnit time limits with sensible timeout values#60739
Conversation
|
nit: I think "perf" implies improving performance of the actual application, not the test suite. |
There was a problem hiding this comment.
Pull request overview
This PR updates the PHPUnit configuration and CI workflows to actually enforce per-test time limits (with more realistic thresholds), and speeds up a particularly expensive LDAP mapping test by reducing unnecessary DB inserts.
Changes:
- Enable PHPUnit time-limit enforcement and set new default/small/medium/large timeouts in the autotest XML configs.
- Update GitHub Actions PHPUnit-related workflows to clear
disable_functionswhen usingini-file: development, sopcntl_signalis available for enforced timeouts. - Reduce DB writes in
AbstractMappingTestCase::testGetListOfIdsByDn()while keeping the query-chunking scenario.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/phpunit-autotest.xml | Enables enforceTimeLimit and sets new default/size-based timeouts for the main server test suite. |
| tests/phpunit-autotest-external.xml | Enables enforceTimeLimit and sets new default/size-based timeouts for files_external tests. |
| apps/user_ldap/tests/Mapping/AbstractMappingTestCase.php | Cuts DB inserts in the chunking test to speed up execution. |
| .github/workflows/phpunit-sqlite.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-pgsql.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-oci.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-mysql.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-mysql-sharding.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-memcached.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/phpunit-mariadb.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/object-storage-swift.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/object-storage-s3.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/object-storage-azure.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/files-external.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/files-external-webdav.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/files-external-smb.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
| .github/workflows/files-external-s3.yml | Clears disable_functions for development ini preset so PHPUnit timeouts can be enforced. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
provokateurin
left a comment
There was a problem hiding this comment.
Please remove all changes unrelated to changing the phpunit configs.
bc6e4d1 to
9ff8da0
Compare
|
Needs #60756 |
|
Please remove the unrelated workflow changes. |
|
/backport to stable34 |
you mean |
PHPUnit's enforceTimeLimit was disabled, meaning the timeoutForSmallTests, timeoutForMediumTests and timeoutForLargeTests config values had no effect. Enable enforcement and set realistic limits: 60s/300s/600s for small/medium/large, with a 300s default for unannotated tests. Also clear disable_functions in the PHP development ini preset across all PHPUnit workflows so pcntl_signal is available — without it the signal handler that drives timeout enforcement cannot be registered. Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
9ff8da0 to
2c86e1d
Compare
Summary
enforceTimeLimitinphpunit-autotest.xmlandphpunit-autotest-external.xml— without this the timeout values are configured but never checkeddisable_functionsin the PHP development ini preset across all PHPUnit workflows sopcntl_signalis available — required for PHPUnit's signal-based timeout enforcement to workThe LDAP mapping test speedup originally in this PR has been split into #60756.
Test plan
🤖 Generated with Claude Code