diff --git a/lib/hobo/vm.rb b/lib/hobo/vm.rb index 484012985..7b0a264ef 100644 --- a/lib/hobo/vm.rb +++ b/lib/hobo/vm.rb @@ -174,13 +174,14 @@ error logger.info "Waiting for VM to boot..." Hobo.config[:ssh][:max_tries].to_i.times do |i| - sleep 5 unless ENV['HOBO_ENV'] == 'test' logger.info "Trying to connect (attempt ##{i+1} of #{Hobo.config[:ssh][:max_tries]})..." if Hobo::SSH.up? logger.info "VM booted and ready for use!" return true end + + sleep 5 unless ENV['HOBO_ENV'] == 'test' end logger.info "Failed to connect to VM! Failed to boot?" diff --git a/test/hobo/vm_test.rb b/test/hobo/vm_test.rb index 4acfb8fe1..ab0984d37 100644 --- a/test/hobo/vm_test.rb +++ b/test/hobo/vm_test.rb @@ -113,6 +113,7 @@ class VMTest < Test::Unit::TestCase should "start the VM in headless mode" do @mock_vm.expects(:start).with(:headless, true).once + Hobo::SSH.expects(:up?).once.returns(true) @vm.start end