summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Ball <tyler-ball@users.noreply.github.com>2015-03-11 13:40:24 -0700
committerTyler Ball <tyler-ball@users.noreply.github.com>2015-03-11 13:40:24 -0700
commitf400002d1a68b8ee672dea92ddfc6ff15624d9d2 (patch)
tree78a10ce2ba681dc265614201cfb3797fb33652a0
parentd152df315510d004532ef93b03d53f648c054a81 (diff)
parent3dfddeec7c896668abd6e344f4c70fbf770dadc2 (diff)
downloadchef-f400002d1a68b8ee672dea92ddfc6ff15624d9d2.tar.gz
Merge pull request #3039 from chef/tball/nightlies
Chef-DK nightlies on debian and el6 have been failing on these timing-based tests, doing a quick fix
-rw-r--r--spec/spec_helper.rb1
-rw-r--r--spec/unit/application/client_spec.rb11
2 files changed, 8 insertions, 4 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 0695450142..fb284c721b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -110,6 +110,7 @@ RSpec.configure do |config|
# Tests that randomly fail, but may have value.
config.filter_run_excluding :volatile => true
config.filter_run_excluding :volatile_on_solaris => true if solaris?
+ config.filter_run_excluding :volatile_from_verify => false
# Add jruby filters here
config.filter_run_excluding :windows_only => true unless windows?
diff --git a/spec/unit/application/client_spec.rb b/spec/unit/application/client_spec.rb
index ea2ad473e5..b4445a9ff9 100644
--- a/spec/unit/application/client_spec.rb
+++ b/spec/unit/application/client_spec.rb
@@ -305,7 +305,10 @@ describe Chef::Application::Client, "run_application", :unix_only do
allow(Chef::Daemon).to receive(:daemonize).and_return(true)
end
- it "should exit hard with exitstatus 3" do
+ # In ChefDK builds this sometimes fails from `chef verify`. If the test
+ # begins to fail for normal chef builds, change it to :volatile completely
+ # https://github.com/chef/chef/pull/3039
+ it "should exit hard with exitstatus 3", :volatile_from_verify do
pid = fork do
@app.run_application
end
@@ -320,9 +323,9 @@ describe Chef::Application::Client, "run_application", :unix_only do
end
expect(@pipe[0].gets).to eq("started\n")
Process.kill("TERM", pid)
- Process.wait
- sleep 1 # Make sure we give the converging child process enough time to finish
- expect(IO.select([@pipe[0]], nil, nil, 0)).not_to be_nil
+ Process.wait(pid)
+ # The timeout value needs to be large enough for the child process to finish
+ expect(IO.select([@pipe[0]], nil, nil, 15)).not_to be_nil
expect(@pipe[0].gets).to eq("finished\n")
end
end