perf(tests): enforce PHPUnit time limits with sensible timeout values#60739
Open
miaulalala wants to merge 6 commits into
Open
perf(tests): enforce PHPUnit time limits with sensible timeout values#60739miaulalala wants to merge 6 commits into
miaulalala wants to merge 6 commits into
Conversation
The timeout attributes were defined but never enforced because enforceTimeLimit was missing. Adds enforceTimeLimit="true" and reduces values from the 900s blanket default to 60s/300s/600s for small/medium/large tests. Unannotated tests default to medium (300s), cutting the worst-case hang time per test from 15 min to 5 min. Signed-off-by: Anna Larch <anna@larch.dev> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Anna Larch <anna@nextcloud.com>
added 5 commits
May 26, 2026 17:56
… values Signed-off-by: Anna Larch <anna@nextcloud.com>
… values Signed-off-by: Anna Larch <anna@nextcloud.com>
… values Signed-off-by: Anna Larch <anna@nextcloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enforceTimeLimit="true"anddefaultTimeLimit="300"to bothphpunit-autotest.xmlandphpunit-autotest-external.xml60s/300s/600sfor small / medium / large annotated testsini-values: disable_functions=""to all phpunit workflow files that useini-file: developmentAbstractMappingTestCase::testGetListOfIdsByDnfrom 3,332 to 14Why
The
timeoutForSmallTests/Medium/Largeattributes had no effect becauseenforceTimeLimitwas never set totrue. A hanging test could silently block a CI job for up to 15 minutes before the runner-level timeout kicked in.On
defaultTimeLimit: Nearly all existing tests have no size annotation (#[Small]/#[Medium]/#[Large]). WithoutdefaultTimeLimit, PHPUnit 10 falls back to a 1-second default for unannotated tests, which broke the entire suite. SettingdefaultTimeLimit="300"is an intentional safety net: it delivers the primary value of this change (hung tests cut at 5 min instead of 15) without requiring a mass annotation effort upfront.Annotating tests with explicit sizes is better done incrementally — when a test is being modified, the author adds
#[Small]or#[Large]as appropriate. This PR establishes the framework; annotation coverage can grow naturally from here.On
ini-values: disable_functions="": PHP'sdevelopmentini preset disablespcntl_signalviadisable_functions. PHPUnit'senforceTimeLimitrelies onpcntl_signalto interrupt hung tests; without it, PHPUnit emits a runner-level warning ("pcntl extension required for enforcing time limits"). Because our workflows pass--fail-on-warning, that warning fails the entire job. Clearingdisable_functionswithini-values: disable_functions=""re-enablespcntl_signalso enforcement actually works and the warning is suppressed.On
testGetListOfIdsByDn: The test intentionally uses 66,640 DNs (just over PostgreSQL's 65,535-value IN list limit) to verify thatgetListOfIdsByDn()correctly chunks and merges queries. However, it was also mapping every 20th DN, resulting in 3,332 DB inserts — far more than needed to verify the chunking behaviour. Reduced to every 5,000th DN (14 inserts) which still crosses the chunk boundary and validates the merge logic, but runs in a fraction of the time on slow backends like Oracle.Notes
#[Large]rather than raising the defaultTest plan
TimeoutExceptionfailures across all PHPUnit jobs🤖 Generated with Claude Code