Re-added the sleep
This commit is contained in:
parent
2c1483ae80
commit
0ebebe14a0
|
@ -26,7 +26,7 @@ error
|
||||||
@runner.vm.start(:headless, true)
|
@runner.vm.start(:headless, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def wait_for_boot
|
def wait_for_boot(sleeptime=5)
|
||||||
logger.info "Waiting for VM to boot..."
|
logger.info "Waiting for VM to boot..."
|
||||||
|
|
||||||
current_timeout = Vagrant.config.ssh.timeout
|
current_timeout = Vagrant.config.ssh.timeout
|
||||||
|
@ -41,6 +41,7 @@ error
|
||||||
end
|
end
|
||||||
|
|
||||||
current_timeout += Vagrant.config.ssh.retry_timeout_delta unless current_timeout >= max_timeout
|
current_timeout += Vagrant.config.ssh.retry_timeout_delta unless current_timeout >= max_timeout
|
||||||
|
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
|
assert @action.wait_for_boot(0)
|
||||||
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
|
assert !@action.wait_for_boot(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
should "slowly increase timeout given to up? up to maximum specified" do
|
should "slowly increase timeout given to up? up to maximum specified" do
|
||||||
|
|
Loading…
Reference in New Issue