pact-foundation / pact-mock_service

Provides a mock service for use with Pact
https://pact.io
MIT License
73 stars 69 forks source link

Mock service does not start on Windows because Windows does not implement fork #73

Closed bethesque closed 6 years ago

bethesque commented 7 years ago

Adding this here to track the issue.

I'm working on a branch of the mock service here to implement pact-mock-service start using spawn instead of fork. I can get it to start up ok, but I can't work out how to kill the process gracefully (SIGTERM). It always needs to be killed with a SIGKILL, which means that the shutdown hook on the mock service won't execute.

bethesque commented 7 years ago

Useful links: https://stackoverflow.com/questions/813086/can-i-send-a-ctrl-c-sigint-to-an-application-on-windows/15281070#15281070 https://www.codeproject.com/Articles/6819/SendKeys-in-C https://gist.github.com/rdp/f51fb274d69c5c31b6be https://github.com/axboe/fio/issues/147

bethesque commented 6 years ago

Closing. Each non-ruby implementation should use the service command rather than the start command, and handle shutting down the mock service process itself.

YOU54F commented 1 year ago

Thank you past @bethesque for this 🍪 trail, this got me last night