The cache is always written to the same file, for each worker and for the controller.
Controller don't execute tests and never has cache. Each worker has part of the cache, so they must get current cache to update it instead of just write to it.
It's still possible to some overwrite happen because workers don´t have a global lock. The pytest-xdist suggests to use filelock to solve this problem, but it is an external dependency.
Fix #94.
The cache is always written to the same file, for each worker and for the controller.
Controller don't execute tests and never has cache. Each worker has part of the cache, so they must get current cache to update it instead of just write to it.
It's still possible to some overwrite happen because workers don´t have a global lock. The pytest-xdist suggests to use
filelock
to solve this problem, but it is an external dependency.