test: warm up discovery before timing an empty scan - #371
Merged
Merged
Conversation
The first scan in a process loads the discoverer's classes (150-225 ms idle), which pushed the empty-directory scan past the 250 ms threshold under pest --parallel.
Merged
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.
Problem
DiscoveryCacheManagerSlowScanTest › says nothing about a location that scans quicklyfailed in most localpest --parallelruns (Method warning() … should be called exactly 0 times but called 1 times), never in serial runs or CI.The test times a real scan of an empty directory against the 250 ms slow-scan threshold. Instrumenting
getStructuresForLocation():The first scan pays for loading the discoverer's classes; under parallel load that alone crosses the threshold. Reproduced in isolation: 3/10 failures with the CPU saturated.
Change
Test only: one warm-up scan of another empty directory before the measured one. The threshold and the product code are unchanged.
Result
0/15 failures with the CPU saturated; full suite in parallel 6/6 green (1367 tests).