Skip to content

Commit

Permalink
(maint) Rewrite kill test for PUP-6675
Browse files Browse the repository at this point in the history
The test around Puppet starting after a previous Puppet run has
completed previously relied on Windows behavior where the Puppet process
would exit completely even though a child process is still running.

PUP-6675 changes Puppet to use pipes for stdout from invoking a child
process; if Puppet is terminated while the child process is still
running, it will still have a valid process handle until the child
process exits (and closes the shared pipe). This is explained in
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686714(v=vs.85).aspx.

Puppet terminating while a direct child process is still running is not
normal behavior, so modify the test to not rely on it.
  • Loading branch information
MikaelSmith committed May 8, 2017
1 parent e50f014 commit 13f92ef
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
transaction_ids = start_puppet_non_blocking_request(master, target_identities)
end

teardown do
# Make sure we stop sleep processes when the test finishes, to avoid leaving stranded processes running.
stop_sleep_process(agents)
end

agents.each do |agent|
step "Kill the first agent run on #{agent}" do
lockfile = nil
Expand All @@ -75,6 +70,10 @@
else
on agent, "kill -9 #{pid}"
end

# Also halt the sleep process here, as on Windows the parent process won't exit while the child process
# has an open handle shared with it (the stdout pipe).
stop_sleep_process(agents)
end
end

Expand Down

0 comments on commit 13f92ef

Please sign in to comment.