node-test-runner: elm-test hangs
I’m having issues with elm-test hanging, both on my 2016 Macbook Pro, a Dell XPS 15 and on our CI server.
On my MBP I’m consistently able to reproduce (in a fresh ubuntu vm) by:
- Installing nvm and node 8
- Installing elm and elm-test via npm
- Running
elm-package installandelm-test init - Running
elm-testin a loop
Using this approach it appears to hang after ~25 runs on my MBP. Same results trying something similar on native OSX.
On the Dell XPS 15 the raciness is even worse, hangs about 1 in 4 runs.
I also did try using elm-test directly from master (with the unix-socket changes), and was a lot less racy, but it still hung from time to time.
Downgrading to elm-test 0.18.7 solved the problem.
Let me know if there is anything else you need. Appreciate the great work!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 5
- Comments: 20 (5 by maintainers)
Commits related to this issue
- upgrade elm-test to fix rtfeldman/node-test-runner#219 — committed to leifg/create-elm-app by leifg 7 years ago
- Allow running multiple instances of elm-test in parallel Using the process ID of the main process in the name of the sockets means multiple parallel instances of elm-test won't clash or try to use th... — committed to rtfeldman/node-test-runner by zwilias 7 years ago
We’ve encountered this problem too, but I’m fairly sure it was solved by this 4ecd1068f31e221104454b85d6c0b2c8b8f9902c (the very first commit after 0.18.9).
Setup to reproduce:
I can reproduce by running this bash snippet, essentially trying to run the simplest test multiple times:
It might not hang running that test just once, but it will consistently hang at some point during the 20 iterations.
Doing a git bisect, I ended up narrowing the problem down to one of these commits, probably (I can’t be 100% sure as the tests didn’t run for me on these commits, so I skipped them):
But as I said, I couldn’t reproduce the issue after 4ecd1068f31e221104454b85d6c0b2c8b8f9902c, so I think using unix pipes instead of process.send() has fixed it.
@rtfeldman any chance of an NPM patch release with at least that one extra commit?
@7er sorry! Fixed.
@jasononeil Thank you for the amazing level of detail! 😻 Published as
0.18.10- on this version I can’t reproduce a hang locally after running it 200 times onexample/on Node 8.4.0 on macOS High Sierra.@smucode @7er @giulioungaretti @leifg @isaacseymour can you see if upgrading to
elm-test0.18.10 fixes it for you?I tried to reproduce on node 8.2.1 and can confirm it does hang after running elm-test in a loop for a minute or two (running the string reverse example test). It does seem to happen less frequently than before, but that might be to me upgrading to high sierra or some other random factor.