summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-03-31 15:26:57 -0700
committerGitHub <noreply@github.com>2020-03-31 15:26:57 -0700
commit8609edf509cfb3fa8f5d519dee996aecd3ef1a4b (patch)
tree147a7965d5128ce8c1143d92c83bf4f95147abad
parent11a6a7331969da7cb2ffe3896a334f23124fbd6b (diff)
parent9c451e3e44c44fa716b0ffb188d487221b6d9f96 (diff)
downloadchef-8609edf509cfb3fa8f5d519dee996aecd3ef1a4b.tar.gz
Merge pull request #9559 from chef/file_descriptor_14
Fix file descriptor leak in our tests
-rw-r--r--spec/functional/run_lock_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/functional/run_lock_spec.rb b/spec/functional/run_lock_spec.rb
index d9a8bd2d0e..08a2c84e90 100644
--- a/spec/functional/run_lock_spec.rb
+++ b/spec/functional/run_lock_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2012-2016, Chef Software, Inc.
+# Copyright:: Copyright 2012-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -404,6 +404,12 @@ describe Chef::RunLock do
example.log_event("#{name}.stop finished (pid #{pid} wasn't running)")
end
end
+
+ # close the IO.pipes so we don't leak them as open filehandles
+ @read_from_process.close rescue nil
+ @write_to_tests.close rescue nil
+ @read_from_tests.close rescue nil
+ @write_to_process.close rescue nil
end
def fire_event(event)