Fix busy test to wait for thread to start

This commit is contained in:
Jonathan Rudenberg 2010-03-09 09:47:24 -05:00 committed by Mitchell Hashimoto
parent aff8343948
commit 145f904ed3
1 changed files with 3 additions and 1 deletions

View File

@ -54,9 +54,11 @@ class BusyTest < Test::Unit::TestCase
should "report busy to the outside world regardless of thread" do should "report busy to the outside world regardless of thread" do
Thread.new do Thread.new do
Vagrant.busy do Vagrant.busy do
sleep(1) sleep(2)
end end
end end
# Give the thread time to start
sleep(1)
# While the above thread is executing vagrant should be busy # While the above thread is executing vagrant should be busy
assert Vagrant.busy? assert Vagrant.busy?