We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b041082 commit 28f92adCopy full SHA for 28f92ad
spec/concurrent/exchanger_spec.rb
@@ -50,20 +50,15 @@ module Concurrent
50
context 'with timeout' do
51
it 'should block until timeout' do
52
53
- latch = Concurrent::CountDownLatch.new(1)
54
value = 0
55
start = Time.now.to_f
56
57
- t = Thread.new do
58
- value = exchanger.exchange(2, 0.2)
59
- latch.count_down
+ future = Concurrent::Future.execute do
+ exchanger.exchange(2, 0.2)
60
end
61
-
62
- latch.wait(1)
63
+
+ future.value.should be_nil
64
(Time.now.to_f - start).should >= 0.2
65
- t.status.should be_false
66
- value.should be_nil
67
68
69
0 commit comments