Skip to content

test: warm up discovery before timing an empty scan - #371

Merged
ogorzalka merged 1 commit into
developfrom
fix/slow-scan-test-warm-up
Sep 30, 2026
Merged

ogorzalka merged 1 commit into
developfrom
fix/slow-scan-test-warm-up

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Problem

DiscoveryCacheManagerSlowScanTest › says nothing about a location that scans quickly failed in most local pest --parallel runs (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():

first scan in the process following scans
idle 150–225 ms ~1 ms
16 busy cores 252–421 ms ~1 ms

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).

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.
@ogorzalka
ogorzalka merged commit 038b855 into develop Sep 30, 2026
11 checks passed
@ogorzalka
ogorzalka deleted the fix/slow-scan-test-warm-up branch September 30, 2026 11:35
@ogorzalka ogorzalka mentioned this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant