calabash-cucumber 0.9.85 → 0.9.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/calabash-cucumber/core.rb +13 -12
- data/lib/calabash-cucumber/version.rb +1 -1
- metadata +1 -1
@@ -351,23 +351,24 @@ module Calabash
|
|
351
351
|
|
352
352
|
def make_http_request(url, req)
|
353
353
|
body = nil
|
354
|
-
|
355
|
-
|
354
|
+
CAL_HTTP_RETRY_COUNT.times do |count|
|
355
|
+
begin
|
356
356
|
if not (@http) or not (@http.started?)
|
357
357
|
@http = init_request(url)
|
358
358
|
@http.start
|
359
359
|
end
|
360
360
|
body = @http.request(req).body
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
361
|
+
break
|
362
|
+
rescue Errno::ECONNRESET, EOFError, Errno::ECONNREFUSED => e
|
363
|
+
if count < CAL_HTTP_RETRY_COUNT-1
|
364
|
+
puts "Retrying.. (#{e})"
|
365
|
+
sleep(0.3)
|
366
|
+
else
|
367
|
+
puts "Failing..."
|
368
|
+
raise e
|
369
|
+
end
|
370
|
+
end
|
371
|
+
end
|
371
372
|
|
372
373
|
body
|
373
374
|
end
|