diff options
author | Hui Hu <huh@vmware.com> | 2014-09-04 16:57:32 +0800 |
---|---|---|
committer | Hui Hu <huh@vmware.com> | 2014-09-04 16:57:32 +0800 |
commit | 3d3aa968f88ed27dcaf19aa82c730cf34cce7441 (patch) | |
tree | f3cf6123bc5a3c463135f51bb9732dd7f01de7b9 /spec/unit/rest_spec.rb | |
parent | ace6c1e64fa32efcb9beeb8238edb1d71dab659d (diff) | |
download | chef-3d3aa968f88ed27dcaf19aa82c730cf34cce7441.tar.gz |
read http_retry_count from chef config in the spec; add HTTP error code in the log.
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r-- | spec/unit/rest_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index f82e4f5472..4d4dccaba6 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -527,10 +527,11 @@ describe Chef::REST do http_response end - it "retries 5 times and throws an exception" do + it "retries then throws an exception" do rest.stub(:sleep) expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError) - expect(log_stringio.string).to match(Regexp.escape("ERROR: Server returned error for #{url}, retrying 5/5")) + count = Chef::Config[:http_retry_count] + expect(log_stringio.string).to match(Regexp.escape("ERROR: Server returned error 500 for #{url}, retrying #{count}/#{count}")) end end end |