Optimize test suite duration by caching test infrastructure#4004
Open
Optimize test suite duration by caching test infrastructure#4004
Conversation
Reduces test_duration from ~454s to ~301s (33% improvement)
Addon loading (especially RuboCop addon) costs ~103ms per test. Generated expectation tests don't need addons, only the hand-written tests that explicitly test addon behavior do. Reduces test_duration from ~301s to ~217s (28% improvement).
Most hand-written tests in these classes don't need addons. Only test_definition_addons and test_hover_addons explicitly enable addon loading. Saves ~3s from avoiding ~79 addon activation cycles.
d143dc6 to
1454173
Compare
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
RuboCopFormatterat the class level in formatting and diagnostics expectation tests, avoiding repeated creation ofRuboCopRunnerinstances (2 per test × 2,352 tests)GlobalStateat the class level inExpectationsTestRunner, avoiding redundant initialization per testwith_server(load_addons: true)costs ~38ms vs ~2ms without)In total, this reduces the CI duration by about 10min (~30 -> 20), which is a 33% reduction.
Test plan