Method: Beaker::Host#wait_for_port
- Defined in:
- lib/beaker/host.rb
#wait_for_port(port, attempts = 15) ⇒ Object
Wait for a port on the host. Useful for those occasions when you’ve called host.reboot and want to avoid spam from subsequent SSH connections retrying to connect from say retry_on()
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/beaker/host.rb', line 103 def wait_for_port(port, attempts=15) @logger.debug(" Waiting for port #{port} ... ", false) start = Time.now done = repeat_fibonacci_style_for(attempts) { port_open?(port) } if done @logger.debug('connected in %0.2f seconds' % (Time.now - start)) else @logger.debug('timeout') end done end |