Open dpinol opened 5 months ago
Please elaborate on the actual numbers
The length of ".pytest_cache/v/cache/nodeids" depends on the usage. I guess I executed at some time with millions of executions and got the file with so many lines. In that case, on my intel i9 a trivial test took 4s, while after removing the file the whole execution now takes 0.3s
I tried to reproduce it. I executed 1M times a file with 2 tests. It created a cache file of 143M with 2M entries. Executing the tests a single time passed from 0.4s to 2.4s
as repeat uses parameterize - i suspect a breaking change is needed to make this more usable
You can disable caching entirely while running large counts with -p no:cacheprovider
.
Would that work?
When running many repeatitions of a test with
--count
,.pytest_cache/v/cache/nodeids
may get up to millions of entries. Eg:This may cause a lag of several seconds even after executing a single method with
-k
specifying a single test file.The culprit is
pytest_sessionfinish
incacheprovider.py
, when callingconfig.cache.set("cache/nodeids", sorted(self.cached_nodeids))
. Whencached_nodeids
contains milions of entries, this function always generates a json with the whole contents of.pytest_cache/v/cache/nodeids
.