Skip to content

Commit

Permalink
Fixed timing in FixedThreadPool tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdantonio committed Oct 11, 2013
1 parent 4e96d26 commit 451a667
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/concurrent/thread_pool_shared.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

it 'stops accepting new tasks' do
subject.post{ sleep(1) }
sleep(0.1)
subject.kill
@expected = false
subject.post{ @expected = true }.should be_false
Expand All @@ -79,6 +80,7 @@
it 'attempts to kill all in-progress tasks' do
@expected = false
subject.post{ sleep(1); @expected = true }
sleep(0.1)
subject.kill
sleep(1)
@expected.should be_false
Expand All @@ -88,6 +90,7 @@
@expected = false
subject.post{ sleep(0.5) }
subject.post{ sleep(0.5); @expected = true }
sleep(0.1)
subject.kill
sleep(1)
@expected.should be_false
Expand Down

0 comments on commit 451a667

Please sign in to comment.