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

dbtest: Use os.Kill on Windows instead of os.Interrupt #158

Merged
merged 1 commit into from
May 9, 2018

Conversation

ddspog
Copy link

@ddspog ddspog commented May 8, 2018

os.Interrupt signal doesn't work on Windows.

This issue has frozen on Golang community due to age. They instruct the use of os.Kill when working with signals on Windows. That's the case for dbtest package.

I've stumbled upon this when working with a Wrapper for this DBServer and testing the dbserver.Stop() function. It doesn't stop the process on Windows (where I work), and panic due to timeout.

With this change, my tests work now in Windows. I didn't change the behavior of other systems.

I've added a use for os.Kill, instead of os.Interrupt signal, when using
Windows. I'm current developing my project on Windows, and using
DBServer.Stop() was resulting in: "timeout waiting for mongod process to
die". After investigating, I've discovered that os.Interrupt isn't
implemented on Windows, and it seems golang has Frozen this issue due to
age (2013). They instruct to use os.Kill instead. Using this, the
DBServer on my project works with no problem.
@domodwyer
Copy link

Hi @ddspog

Thanks for taking the time to open a PR! Looks good 👍

Dom

@domodwyer domodwyer merged commit a46ca38 into globalsign:development May 9, 2018
@domodwyer domodwyer mentioned this pull request Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants