opscode/mixlib-shellout — pull request #66 by Annih (2014-10-15 16:42:16+00:00)
Title: Windows implementation does not kill the process on timeout

Hi,

[Despite the comment](https://github.com/opscode/mixlib-shellout/blob/master/lib/mixlib/shellout/windows.rb#L112), the windows' run_command implementation is not terminating the process.
```ruby
# Kill the process
if (Time.now - start_wait) > timeout
raise Mixlib::ShellOut::CommandTimeout, "command timed out:\n#{format_for_exception}"
end
```
It raises an exception, ensures that some handles are closed and that pipes are empty, but it does not properly terminate the process.

It's easy to reproduce with the sleep command, because you'll have to wait the whole sleep duration:
```ruby
require 'mixlib/shellout'
cmd = Mixlib::ShellOut.new('sleep 30')
cmd.timeout = 1
cmd.run_command
```

So I only added a call to the `TerminateProcess` function to be sure that the process is killed when the timeout is reached. Perhaps this behavior should be toggled by an additional option.