globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

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

Closed ddspog closed 6 years ago

ddspog commented 6 years ago

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.

domodwyer commented 6 years ago

Hi @ddspog

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

Dom