Skip to content

Cache does not work with multiple jest workers #82

@imjeremyhi

Description

@imjeremyhi

When using jest with multiple workers the .eslintcache looks like it is being overwritten by every worker. Hence adding the cache option makes no difference to performance.

Happy to try work on a PR to fix the cache overwriting issue but would need some guidance on what kind of approach would be appropriate.
My initial ideas would be:

  1. A separate folder which creates a cache file for every file. This prevents most of the concurrency issues but may lead to a significantly large memory overhead and lots of os reads.
  2. Pass information to all spawned workers of the current run, and then lock the cache writes so each worker correctly appends to the file.
  3. Or alternatively all workers create separate cache files and they get merged together in the end into a single cache file.

Do any of these ideas seem appropriate? In the meantime will do some more digging around the code base.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions