binygal / jest-runner-flowtype

Jest runner for running flowtype tests using jest as a platform
26 stars 10 forks source link

Fix windows hang #10

Closed Klathmon closed 6 years ago

Klathmon commented 6 years ago

PLEASE DO NOT MERGE WITHOUT REVIEW!

I was having random issues with flow hanging only when run in this plugin on windows.

It seemed to stem from some issues with this plugin spawning a full server sometimes, and not other times because it was using the flow command (it seemed to be caused by my editor also spawning a flow server, but sometimes the timing would cause one or both to hang).

This PR moves it to using the flow check command which works mostly the same, but it doesn't spawn or use an independent server and instead does a full check on it's own then dies (which seems more "correct" for how this plugin expects to run), and it runs the command in a shell which will increase startup time by a VERY small amount (once per test run, not once per file), and gives it the full environment. All of these together seemed to fix my issues.

I'm not sure which base to make this PR to as both master and initial seemed like good candidates... And I'm almost positive there will be some changes needed as I seemed to have messed something up and there are changes made that I didn't make...

Please don't hesitate to ask me to refine this somehow or make any changes at all. I wanted to make the PR now before I forgot and get it out there in case someone else is having the same issues as me!

binygal commented 6 years ago

Thank you for your contribution! Let's work it out together so we can merge it. Can you rebase your code on top of master? Then change the PR to merge into the new windows branch. After that I will review it. (Don't hesitate to ask for any help if you need 😃 )

binygal commented 6 years ago

Hey @Klathmon can you send me an email to binygal@gmail.com? Lets work this PR out.

Klathmon commented 6 years ago

@binygal Hey sorry, I didn't even see that you replied, it's been a hectic few weeks!

I'll close this one and just start again branching from windows. It's only a few lines of change and I wanted to get rid of one of the changes I made now that flow 0.79 works differently (running flow will now use a pre-made cache, unlike before, so now flow check is significantly slower)