Removed sleeping from waiting for boot since the timeout should handle that
This commit is contained in:
parent
6478927bae
commit
b03af8ccc2
|
@ -26,7 +26,7 @@ error
|
||||||
@runner.vm.start(:headless, true)
|
@runner.vm.start(:headless, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def wait_for_boot(sleeptime=5)
|
def wait_for_boot
|
||||||
logger.info "Waiting for VM to boot..."
|
logger.info "Waiting for VM to boot..."
|
||||||
|
|
||||||
Vagrant.config[:ssh][:max_tries].to_i.times do |i|
|
Vagrant.config[:ssh][:max_tries].to_i.times do |i|
|
||||||
|
@ -36,8 +36,6 @@ error
|
||||||
logger.info "VM booted and ready for use!"
|
logger.info "VM booted and ready for use!"
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
sleep sleeptime
|
|
||||||
end
|
end
|
||||||
|
|
||||||
logger.info "Failed to connect to VM! Failed to boot?"
|
logger.info "Failed to connect to VM! Failed to boot?"
|
||||||
|
|
|
@ -44,12 +44,12 @@ class BootActionTest < Test::Unit::TestCase
|
||||||
seq = sequence('pings')
|
seq = sequence('pings')
|
||||||
Vagrant::SSH.expects(:up?).times(Vagrant.config[:ssh][:max_tries].to_i - 1).returns(false).in_sequence(seq)
|
Vagrant::SSH.expects(:up?).times(Vagrant.config[:ssh][:max_tries].to_i - 1).returns(false).in_sequence(seq)
|
||||||
Vagrant::SSH.expects(:up?).once.returns(true).in_sequence(seq)
|
Vagrant::SSH.expects(:up?).once.returns(true).in_sequence(seq)
|
||||||
assert @action.wait_for_boot(0)
|
assert @action.wait_for_boot
|
||||||
end
|
end
|
||||||
|
|
||||||
should "ping the max number of times then just return" do
|
should "ping the max number of times then just return" do
|
||||||
Vagrant::SSH.expects(:up?).times(Vagrant.config[:ssh][:max_tries].to_i).returns(false)
|
Vagrant::SSH.expects(:up?).times(Vagrant.config[:ssh][:max_tries].to_i).returns(false)
|
||||||
assert !@action.wait_for_boot(0)
|
assert !@action.wait_for_boot
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue