diff options
author | Claire McQuin <mcquin@users.noreply.github.com> | 2014-10-02 10:15:39 -0700 |
---|---|---|
committer | Claire McQuin <mcquin@users.noreply.github.com> | 2014-10-02 10:15:39 -0700 |
commit | 582bec42aa1a5feb9693f72102b77b2fe468f092 (patch) | |
tree | 913a593cb94a5f14515382d57cbd8e2d2da9f95b /spec/unit/rest_spec.rb | |
parent | 86176e24dc5a3948aa5e1fc8aaf7e022c1b69f46 (diff) | |
parent | 3d3aa968f88ed27dcaf19aa82c730cf34cce7441 (diff) | |
download | chef-582bec42aa1a5feb9693f72102b77b2fe468f092.tar.gz |
Merge pull request #1912 from jessehu/CHEF-ISSUE-1904
retry on HTTP 50X Error when calling Chef REST API
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r-- | spec/unit/rest_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 3ad822193b..424fd12ee9 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -526,9 +526,12 @@ describe Chef::REST do http_response.stub(:read_body) http_response end - it "throws an exception" do + + it "retries then throws an exception" do rest.stub(:sleep) expect {rest.request(:GET, url)}.to raise_error(Net::HTTPFatalError) + 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 |