Skip to content

Commit 52190ba

Browse files
committed
Refactored brittle Exchanger spec.
1 parent 6e2ef27 commit 52190ba

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

spec/concurrent/exchanger_spec.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,11 @@ module Concurrent
4848
end
4949

5050
context 'with timeout' do
51-
it 'should block until timeout', :brittle do
5251

53-
value = 0
52+
it 'should block until timeout', :brittle, :refactored do
5453
start = Time.now.to_f
55-
56-
future = Concurrent::Future.execute do
57-
exchanger.exchange(2, 0.2)
58-
end
59-
60-
future.value.should be_nil
61-
(Time.now.to_f - start).should >= 0.2
54+
exchanger.exchange(2, 0.1).should be_nil
55+
(Time.now.to_f - start).should > 0.1
6256
end
6357
end
6458
end

0 commit comments

Comments
 (0)