Closed ScripterSugar closed 4 months ago
@anonrig any chance for a release with this fix? we're getting issues with the grpc-js >= 1.10 that are resolved with this branch.
@anonrig @bojand can you take a look of this?
Ping 😢
Ping, we need this fix as well 🙏🏻
Ping! Hopefully the tag will be published as soon as possible.
@ScripterSugar You have to validate why the tests failed
I tried to reproduce the test failures locally and I think tests are flaky in general. Most of the time they run fine but from time to time one or two randomly fail. I tested with Node.js 18.20.2 (as was used in the CI run for master branch).
With the latest master commit (3859690cf421c6b0e43d6c04976d0062d81fb1b8) which includes this PR I saw the following tests fail (failure reason in parentheses):
t.end()
was never called)t.end()
was never called)With the previous master commit (479ef62) i.e. before this PR was merged I got similar test failures:
t.end()
was never called)t.end()
was never called)t.end()
was never called)Again: Most of the time all 188 tests pass. But when trying often enough one or two fail with either t.end() was never called
or Rejected promise returned by test
. It seems tests are more likely to fail after a "clean start":
rm -rf node_modules/
npm cache clean --force
npm ci
npm test
So my conclusion is that the failing tests are not related to the change here but where randomly failing before already.
@andres06-hub I didn't touch the tests since the failures were not related to my changes (at least in my judgement), I confirmed that same or similar tests were failing without my changes.
Thank you for the detailed analyzation @n0v1 😄
Hopefully @anonrig is able to make the CI pass and ship this 🙏🏻 Almost there! 🤏
I think the reason tests randomly fails is based on randomness of getPort() function. since the tests runs concurrently there's a chance that ports are randomly collide or chosen port might being used by other process or system.
I'm not sure which approach is best to ensure the chosen port is free to use. I've looked over some third-party libraries like node-portfinder, but it feels like a bit of an overshoot. Since they return the port in promise form, we would have to modify all getPort() and getHost() calls if we decide to use these, and I don't really like that idea.
Any suggestions?
How about running them sequentially instead of concurrently? They're not many and they should be fast, right?
I created #377 to address the randomly failing tests.
Resolving issue #374
@bojand Can you look into the PR? Is this repository still maintained?