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:

  1. Installing nvm and node 8
  2. Installing elm and elm-test via npm
  3. Running elm-package install and elm-test init
  4. Running elm-test in 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

Most upvoted comments

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:

> cd node-test-runner/
> git checkout 432556e
HEAD is now at 432556e... Bump version to 0.18.9
> node -v
v8.7.0
> node bin/elm-test --version
0.18.9

I can reproduce by running this bash snippet, essentially trying to run the simplest test multiple times:

for i in `seq 1 20`; do echo "RUN ${i} of 20"; node bin/elm-test tests/OnePassing.elm ; done

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):

git bisect good There are only 'skip’ped commits left to test. The first bad commit could be any of: 38d2fa98c1daa548b296be4cb509bceb40f7962c d0a9a89bd1bf37057ee0fb0d013d2769d92d24bd We cannot bisect more!

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 on example/ on Node 8.4.0 on macOS High Sierra.

@smucode @7er @giulioungaretti @leifg @isaacseymour can you see if upgrading to elm-test 0.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.