jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Flaky test #313

Open lishaduck opened 1 week ago

lishaduck commented 1 week ago

Moving this thread so I don't lose track of it: ↓

I've noticed this there's a test that's been flaking ("Running using other configuration (without errors)"):

-- UNEXPECTED ERROR ------------------------------------------------------------

I ran into an unexpected error. Please open an issue at the following link:
  https://github.com/jfmengels/node-elm-review/issues/new

Please include this error message and as much detail as you can provide. Running
with --debug might give additional information. If you can, please provide a
setup that makes it easy to reproduce the error. That will make it much easier
to fix the issue.

Below is the error that was encountered.
--------------------------------------------------------------------------------
<local-path>/test/project-with-errors/elm-stuff/generated-code/jfmengels/elm-review/cli/<version>/review-applications/bd2a2bb6c965dac5241ce8c4d0615d83.js:10328
          $temp$offset = offset + 

SyntaxError: Unexpected end of input

  at loadCompiledElmApp (<local-path>/lib/load-compiled-app.js:28:18)
  at initWithoutWorker (<local-path>/lib/app-wrapper.js:144:21)
  "
  at Object.test (test/review.test.js:37:1)

Originally posted by @lishaduck in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2467097204

lishaduck commented 1 week ago

I've noticed this there's a test that's been flaking ("Running using other configuration (without errors)"):

Yes, I've noticed the same thing. I had a look, thinking it could be us not waiting for the compilation to be finalized, but the code looks fine. I still think it's the writing of the file (or the loading of it, but that's weirder) that is getting cut off early somehow, but I haven't figured out how yet. :thinking:

It sounds pretty recent though. I don't think we saw this one before, but I could be wrong.

Originally posted by @jfmengels in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2467667152

lishaduck commented 1 week ago

It sounds pretty recent though. I don't think we saw this one before, but I could be wrong.

Well, it's really started flaking. Will look into it. For reference, here's the first failure from it: https://github.com/jfmengels/node-elm-review/actions/runs/11769034390/job/32779541170

EDIT: Commit-wise, there was a different flake on #306 (it's older than my work here, I think I remember seeing it a while ago), and then fs-extra (#303) seems to have started this flake.

EDIT 2: Am gonna try to see if I reproduce it before #303.

Originally posted by @lishaduck in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2468229277

lishaduck commented 1 week ago

Was able to repro with 38453c161ca3c4273482760b7c4576203e3ced72, so sadly not #303.

Originally posted by @lishaduck in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2468394493

lishaduck commented 1 week ago

Huh. I can't repro on #304 for the life of me,[^1] so I guess it's gotta be #306 (or, I suppose, #305), which makes no sense.

[^1]: I've run tests 10+ 9 times on the commit, to no avail.

Originally posted by @lishaduck in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2468411960

lishaduck commented 1 week ago

@jfmengels, any ideas?

Originally posted by @lishaduck in https://github.com/jfmengels/node-elm-review/issues/308#issuecomment-2469290010

jfmengels commented 1 week ago

I haven't had the time to delve into it more, so my thoughts are still the same as what is written above.

Do you have the power to re-run CI runs by the way or is it only me? (Because if you can, then this is annoying but more easily bypassable).

lishaduck commented 1 week ago

Do you have the power to re-run CI runs by the way or is it only me? (Because if you can, then this is annoying but more easily bypassable).

No, I don't unfortunately (surprisingly, GitHub has a single secure default for actions 🎉 🤣).