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

How is JEST_METADATA_SERVER being shared between parent process and child worker process? #81

Open
madcapnmckay opened this issue Jul 16, 2024 · 1 comment
Labels
question Further information is requested

Comments

@madcapnmckay
Copy link

I'm trying to understand the code. I see JEST_METADATA_SERVER being set by registerServerId, which looks like it would occur during the reporter/parent process. But when not running in band process.env, it would not be present in the environment.

Thanks

@madcapnmckay madcapnmckay added the question Further information is requested label Jul 16, 2024
@noomorph
Copy link
Collaborator

noomorph commented Dec 17, 2024

Hello, @madcapnmckay !

I'm not sure I have understood your question completely, but I try to set JEST_METADATA_SERVER very early, before Jest even creates child worker processes — this automatically grants us passing process.env as we mutate it. Therefore, any child worker spawned by Jest should "inherit" that JEST_METADATA_SERVER from the first second of life.

We actually used the same trick with the Detox IPC server in Detox 20.0.0+, and so far, it has worked okay.

P.S. I apologize for the delay with addressing your comment — it must have slipped under the radar, and I noticed it just now when releasing another fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants