summaryrefslogtreecommitdiff
path: root/spec/tiny_server.rb
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-12-18 11:39:00 -0600
committerJay Mundrawala <jdmundrawala@gmail.com>2015-12-18 11:39:00 -0600
commit939b6317aea3f554639cd110f18ee6b5ee185746 (patch)
treef2e3e9e4472dc200e71168864669db2ea9126ad2 /spec/tiny_server.rb
parent5f51f93f71cdee3ed598b38cecd8f5fa1a585f49 (diff)
downloadchef-939b6317aea3f554639cd110f18ee6b5ee185746.tar.gz
tiny_server should retry Errno::EHOSTUNREACH
AIX seems to raise Errno::EHOSTUNREACH when the server is not ready yet. Our tests on AIX fail with: ``` Errno::EHOSTUNREACH: No route to host - connect(2) for "localhost" port 9000 Shared Example Group: "a file with the wrong content" called from ./spec/support/shared/functional/file_resource.rb:936 Shared Example Group: "a configured file resource" called from ./spec/support/shared/functional/file_resource.rb:279 Shared Example Group: "a file resource" called from ./spec/functional/resource/remote_file_spec.rb:122 # ./spec/tiny_server.rb:91:in `started?' # ./spec/tiny_server.rb:82:in `block in block_until_started' # ./spec/tiny_server.rb:81:in `times' # ./spec/tiny_server.rb:81:in `block_until_started' # ./spec/tiny_server.rb:72:in `start' # ./spec/support/shared/functional/http.rb:45:in `start_tiny_server' # ./spec/functional/resource/remote_file_spec.rb:111:in `block (3 levels) in <top (required)>' ```
Diffstat (limited to 'spec/tiny_server.rb')
-rw-r--r--spec/tiny_server.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/tiny_server.rb b/spec/tiny_server.rb
index 77afde68e1..4f887b19ee 100644
--- a/spec/tiny_server.rb
+++ b/spec/tiny_server.rb
@@ -96,7 +96,8 @@ module TinyServer
sleep 0.1
# If the host has ":::1 localhost" in its hosts file and if IPv6
# is not enabled we can get NetworkUnreachable exception...
- rescue Errno::ENETUNREACH, Net::ReadTimeout, IO::EAGAINWaitReadable => e
+ rescue Errno::ENETUNREACH, Net::ReadTimeout, IO::EAGAINWaitReadable,
+ Errno::EHOSTUNREACH => e
sleep 0.1
false
end