Skip to content

Commit 5953433

Browse files
committed
Add test for fixed behaviour
1 parent 894ac23 commit 5953433

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/concurrent/executor/timer_set_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ module Concurrent
3535
expect(latch.wait(0.2)).to be_truthy
3636
end
3737

38+
it 'executes a given task when given an interval in seconds, even if longer tasks have been scheduled' do
39+
latch = CountDownLatch.new(1)
40+
subject.post(0.5){ nil }
41+
sleep 0.1
42+
subject.post(0.1){ latch.count_down }
43+
expect(latch.wait(0.2)).to be_truthy
44+
end
45+
3846
it 'passes all arguments to the task on execution' do
3947
expected = nil
4048
latch = CountDownLatch.new(1)

0 commit comments

Comments
 (0)