From 0ebebe14a0a833e8fa42bd6ad9a7be2a20c7220e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 11 Mar 2010 19:26:39 -0800 Subject: [PATCH] Re-added the sleep --- lib/vagrant/actions/vm/boot.rb | 3 ++- test/vagrant/actions/vm/boot_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/actions/vm/boot.rb b/lib/vagrant/actions/vm/boot.rb index 08b47e9a2..d5cbc6fe0 100644 --- a/lib/vagrant/actions/vm/boot.rb +++ b/lib/vagrant/actions/vm/boot.rb @@ -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?" diff --git a/test/vagrant/actions/vm/boot_test.rb b/test/vagrant/actions/vm/boot_test.rb index 649a6d52c..6e207f58a 100644 --- a/test/vagrant/actions/vm/boot_test.rb +++ b/test/vagrant/actions/vm/boot_test.rb @@ -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