test: migrated graceful-shutdown.test.js from tap to node:test#825
test: migrated graceful-shutdown.test.js from tap to node:test#825Tony133 wants to merge 10 commits intofastify:mainfrom
Conversation
2a31fae to
2954630
Compare
2954630 to
61c443c
Compare
test/graceful-shutdown.test.js
Outdated
| const sigintHandler = () => { | ||
| try { | ||
| sinon.assert.called(spy) | ||
| t.pass('fastify.close() was called on SIGINT') |
There was a problem hiding this comment.
I think we should check this with a t.plan.
Especially because t.pass is not part of the node test runner, so this test should fail
There was a problem hiding this comment.
The Plan hasn't been inserted.
The assertion could be unchecked and the test would still pass.
There was a problem hiding this comment.
Instead of being async, you should end the test once the assertion has been checked
Contrary to tap, the test runner doesn't wait for the plan to complete
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
|
Most likely, the problem is related to how the SIGINT signal is handled in the CI environment. For now, I have set it to skip the test with Windows, Linux, and macOS. I don't know if this is the right thing to do 😄, see commit here: 0e5cef3 |
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
Co-authored-by: Manuel Spigolon <behemoth89@gmail.com> Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
| process.exit() | ||
| }) | ||
|
|
||
| test('should call fastify.close() on SIGINT', { skip: isWindows || isMacOS || isLinux }, (t) => { |
There was a problem hiding this comment.
if this will not run on windows, macos and linux..it means essentially that will never run
We should keep the check as it was (so just skip windows) and check what's happening

Checklist
npm run testandnpm run benchmarkand the Code of conduct
Proposal:
graceful-shutdown.test.jsfromtaptonode:test🔥