summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2019-12-15 09:05:30 +0000
committerintrigeri <intrigeri@boum.org>2019-12-15 09:05:30 +0000
commit5e7ff8e9e644374bea8120096706855bc3c1b5b2 (patch)
tree09012dd2e6c1d78bb5ee6536eedf52c58511a9fc
parent6d52c445043ba50143d0af7830b00299e5ca49c7 (diff)
Test suite: close communication channels with child processes before killing them (refs: #14948)bugfix/14948-avoid-zombies-in-testsuite-runs+force-all-tests
The "close" method (https://ruby-doc.org/core-2.2.0/IO.html#method-i-close) "Closes ios and flushes any pending writes to the operating system". This could increase the chances that the child process we kill manages to exit (instead of being left as a zombie), by closing any communication channels we may have left open with it. But it's more likely that we get this expected benefit if we run .close before we kill that child process, to increase the success chances of whatever signal handler that child process has setup.
-rw-r--r--features/step_definitions/common_steps.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
index 1d5c107..36078ab 100644
--- a/features/step_definitions/common_steps.rb
+++ b/features/step_definitions/common_steps.rb
@@ -838,7 +838,7 @@ EOF
Process.kill(0, proc.pid) == 1
end
- add_after_scenario_hook { Process.kill("TERM", proc.pid); proc.close }
+ add_after_scenario_hook { proc.close; Process.kill("TERM", proc.pid) }
# It seems necessary to actually check that the LAN server is
# serving, possibly because it isn't doing so reliably when setting