Re-added the sleep

This commit is contained in:
Mitchell Hashimoto 2010-03-11 19:26:39 -08:00
parent 2c1483ae80
commit 0ebebe14a0
2 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,7 @@ error
@runner.vm.start(:headless, true)
end
def wait_for_boot
def wait_for_boot(sleeptime=5)
logger.info "Waiting for VM to boot..."
current_timeout = Vagrant.config.ssh.timeout
@ -41,6 +41,7 @@ error
end
current_timeout += Vagrant.config.ssh.retry_timeout_delta unless current_timeout >= max_timeout
sleep sleeptime
end
logger.info "Failed to connect to VM! Failed to boot?"

View File

@ -44,12 +44,12 @@ class BootActionTest < Test::Unit::TestCase
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?).once.returns(true).in_sequence(seq)
assert @action.wait_for_boot
assert @action.wait_for_boot(0)
end
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)
assert !@action.wait_for_boot
assert !@action.wait_for_boot(0)
end
should "slowly increase timeout given to up? up to maximum specified" do