Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support, or the lack thereof #13

Closed
sudo-suhas opened this issue Dec 21, 2017 · 3 comments
Closed

Windows support, or the lack thereof #13

sudo-suhas opened this issue Dec 21, 2017 · 3 comments

Comments

@sudo-suhas
Copy link
Contributor

I was playing around with this repo and a found that the tests are failing on Windows:

verbose test report
λ yarn test
yarn run v1.3.2
$ mocha lib/**/*.spec.js && npm run test-typings

  Terminus
    1) runs onSigterm when getting the SIGTERM signal
    2) runs onShutdown after onSigterm
    3) runs onSigint when getting SIGINT signal
    4) runs onShutdown after onSigint
    supports onHealthcheck for the healthcheck route
      √ but keeps all the other endpoints
      √ returns 200 on resolve
      √ returns 503 on reject

  3 passing (1s)
  4 failing

  1) Terminus
       runs onSigterm when getting the SIGTERM signal:

      AssertionError: expected '' to deeply equal 'on-sigterm-runs'
      + expected - actual

      +on-sigterm-runs

      at Context.ex (lib\terminus.spec.js:89:46)

  2) Terminus
       runs onShutdown after onSigterm:

      AssertionError: expected '' to deeply equal 'on-sigterm-runs\non-shutdown-runs'
      + expected - actual

      +on-sigterm-runs
      +on-shutdown-runs

      at Context.ex (lib\terminus.spec.js:100:46)

  3) Terminus
       runs onSigint when getting SIGINT signal:

      AssertionError: expected '' to deeply equal 'on-sigint-runs'
      + expected - actual

      +on-sigint-runs

      at Context.ex (lib\terminus.spec.js:111:46)

  4) Terminus
       runs onShutdown after onSigint:

      AssertionError: expected '' to deeply equal 'on-sigint-runs\non-shutdown-runs'
      + expected - actual

      +on-sigint-runs
      +on-shutdown-runs

      at Context.ex (lib\terminus.spec.js:122:46)

error Command failed with exit code 4.

I tried to dig into this a bit and found that the whole concept of SIGTERM is not supported on Windows.

Short story: you can expect SIGINT to work now, as well as SIGBREAK and to some extent SIGHUP. However SIGTERM will never work because killing a process in the task manager is unconditional, e.g. there's no way for an application to detect or prevent it.

Also see nodejs/node#12378.

So can I make a PR which updates the documentation for lack of support on Windows due to inherent OS limitations?

@gergelyke
Copy link
Collaborator

On windows signals are not supported, you are correct (https://nodejs.org/api/process.html).

If you could send a PR that reflects it, that would be awesome!

@sudo-suhas
Copy link
Contributor Author

Sure @gergelyke, I'll do that.

@gergelyke
Copy link
Collaborator

🎉 This issue has been resolved in version 2.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants