Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[heft-jest-plugin] Add a patch to update the Jest ScriptTransformer to disable cache reads/writes #3606

Merged
merged 9 commits into from
Aug 30, 2022

Conversation

D4N14L
Copy link
Member

@D4N14L D4N14L commented Aug 30, 2022

Summary

Jest uses cache files to speed up execution time. However, use of cache files with the heft-jest-plugin seems to cause more problems than it solves (adds I/O overhead, encounters race conditions). We already delete the cache before execution in an attempt to avoid some of these issues. Additionally, cache files for the heft-jest-plugin typescript jest transformer only read a file from disk and feed it to Jest, which means these cache files serve little purpose. This PR patches Jest to disable cache reads/writes entirely.

Fixes jestjs/jest#4444

How it was tested

Tested by debugging into the execution and validating that the patched script is used.

@D4N14L D4N14L changed the title [heft-jest-plugin] Add a patch to update the Jest ScriptTransformer to handle cache file race condition [heft-jest-plugin] Add a patch to update the Jest ScriptTransformer to disable cache reads/writes Aug 30, 2022
@dmichon-msft
Copy link
Contributor

Regarding the description, specifically, cache files for the Heft Typescript Jest transformer are counterproductive, since all the transformer does is read a file from disk and feed it to Jest, so the cache file does nothing useful and adds an extra I/O round trip.

Copy link
Contributor

@dmichon-msft dmichon-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't quite work as written

heft-plugins/heft-jest-plugin/package.json Outdated Show resolved Hide resolved
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.

cache write race condition across processes
2 participants