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

Fix: The test randomly throws exceptions related to module imports #14575

Closed
wants to merge 2 commits into from

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented May 23, 2022

Q                       A
Fixed Issues? The test randomly throws exceptions related to module imports
Patch: Bug Fix?
Major: Breaking Change? ×
Minor: New Feature? ×
Tests Added + Pass?
Documentation PR Link
Any Dependency Changes? ?
License MIT

This is a Proof Of Concept and needs more discussion.
As I mentioned in #14541 (comment), this issue is best fixed by adding new features in jest-light-runner.

jest-light-runner does not isolate tests, and packages\babel-register\test breaks the node built-in environment.
Causes the remaining tests to randomly throw exceptions related to importing the module.

Maybe there are other issues in babel-register that are contributing to this result, but that doesn't matter.

@babel-bot
Copy link
Collaborator

babel-bot commented May 23, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/52000/

@liuxingbaoyu liuxingbaoyu changed the title Fix: Tests randomly appear undefined Fix: The test randomly throws exceptions related to module imports May 23, 2022
@nicolo-ribaudo
Copy link
Member

What breaks the environment?

Module._cache = oldModuleCache;
should restore everything to the state it was before running the tests.

@liuxingbaoyu
Copy link
Member Author

I do not know.
It's so hard to reproduce that I can't debug it.

It's worth mentioning that after applying the patch, I ran the CI 2*50 times without exception!💐

@liuxingbaoyu
Copy link
Member Author

Well I still don't understand why the exception appears and why it disappears, but now this PR is no longer needed.

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Feb 6, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Fixes failing main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants