diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-18 11:50:55 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-08-18 11:56:38 -0700 |
commit | 57d627615cd8aad87dbeed5fd6d0444c15ca1dfa (patch) | |
tree | 8e901016672709233cb00c0ee278e179a1e15b90 | |
parent | f55d0053ce6646d2e925336f6766c3c8e018ad90 (diff) | |
download | chef-57d627615cd8aad87dbeed5fd6d0444c15ca1dfa.tar.gz |
speed up solo test
removes the requirement that the second wait for the first, just that
one of them waits for the other, so if we ever somehow lose that race
and the second wins the run_lock as long as the first sleeps then its
all good...
drops all the sleeps down a lot, thinking about how to make this more
cleverer so that it doesn't sleep but handshakes properly so that we
don't need 25 seconds of sleep on slowaris tests..
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | spec/integration/solo/solo_spec.rb | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb index f142798546..4236b249fa 100644 --- a/spec/integration/solo/solo_spec.rb +++ b/spec/integration/solo/solo_spec.rb @@ -112,7 +112,7 @@ EOM file "cookbooks/x/recipes/default.rb", <<EOM ruby_block "sleeping" do block do - sleep 10 + sleep 0.1 end end EOM @@ -133,9 +133,6 @@ EOM s1 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \ -l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir) - # Give it some time to progress - sleep 5 - # Instantiate the second chef-solo run s2 = Process.spawn("#{chef_solo} -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \ -l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir) @@ -158,18 +155,6 @@ EOM expect(pid_lines.length).to eq(2) pids = pid_lines.map { |l| l.split(" ").last } expect(run_log).to include("Chef client #{pids[0]} is running, will wait for it to finish and then run.") - - # second run should start after first run ends - starts = [ ] - ends = [ ] - run_log.lines.each_with_index do |line, index| - if line.include? "Chef-client pid:" - starts << index - elsif line.include? "INFO: Chef Run complete in" - ends << index - end - end - expect(starts[1]).to be > ends[0] end end |