epicweb-dev / epicshop

The workshop app for all workshops on EpicWeb.dev
https://www.epicweb.dev
Other
205 stars 33 forks source link

Stopping tests somehow kills the app server #74

Closed kentcdodds closed 3 weeks ago

kentcdodds commented 1 year ago

If you run the tests and stop them before they're done, that somehow kills the app server. I have no idea why.

onemen commented 1 year ago

still looking ....

some info: this line runs after the test process killed: GET http://localhost:5639/test?name=playground&v=1 https://github.com/epicweb-dev/kcdshop/blob/b442096f270962da463d2eb3c949a996f726d6a3/packages/workshop-app/app/routes/test.tsx#L195-L197

when the loader run this https://github.com/epicweb-dev/kcdshop/blob/b442096f270962da463d2eb3c949a996f726d6a3/packages/workshop-app/app/routes/test.tsx#L76

remix crashes https://github.com/remix-run/remix/blob/8ec97222cd46f8a716712e69d640f2fb4efacfb2/packages/remix-react/data.ts#L58-L68

maybe we can use abortController to abort the test, then clean testProcess set, and on the test loader return early without calling eventStream

kentcdodds commented 1 year ago

Ah yes, that does make sense

onemen commented 1 year ago

there is some race condition the loader start the fetch for http://localhost:5639/test?name=playground&v=1 before the test process killed

onemen commented 1 year ago

I did not now how to stop both the loader eventStream and the test process without crashing remix

onemen commented 1 year ago

this is still an issue with remix 1.18

kentcdodds commented 3 weeks ago

Fixed. It was something weird with execa. Switch to child_process and it's working fine now.