File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def dereferenceable_subject(value, opts = {})
2222 let! ( :rejected_reason ) { StandardError . new ( 'mojo jojo' ) }
2323
2424 let ( :pending_subject ) do
25- Delay . new ( executor : :fast ) { sleep 0.05 ; fulfilled_value }
25+ Delay . new ( executor : :fast ) { sleep 0.1 ; fulfilled_value }
2626 end
2727
2828 let ( :fulfilled_subject ) do
Original file line number Diff line number Diff line change 917917 end
918918
919919 specify "timing out" do
920- body = { on_thread : -> { m = receive ; sleep 0.01 ; reply m } ,
921- on_pool : -> { receive { |m | sleep 0.01 ; reply m } } }
920+ count_down = Concurrent ::CountDownLatch . new
921+ body = { on_thread : -> { m = receive ; count_down . wait ; reply m } ,
922+ on_pool : -> { receive { |m | count_down . wait ; reply m } } }
922923 a = Concurrent ::ErlangActor . spawn ( type : type , &body . fetch ( type ) )
923924 expect ( a . ask ( :err , 0 , 42 ) ) . to eq 42
925+ count_down . count_down
924926 expect ( a . terminated . value! ) . to eq false
925927
926928 body = { on_thread : -> { reply receive } ,
927929 on_pool : -> { receive { |m | reply m } } }
928- a = Concurrent ::ErlangActor . spawn ( type : type , &body . fetch ( type ) )
929- expect ( a . ask ( :v , 1 , 42 ) ) . to eq :v
930- expect ( a . terminated . value! ) . to eq true
930+ b = Concurrent ::ErlangActor . spawn ( type : type , &body . fetch ( type ) )
931+ expect ( b . ask ( :v , 1 , 42 ) ) . to eq :v
932+ expect ( b . terminated . value! ) . to eq true
931933 end
932934
933935 specify "rejects on no reply" do
You can’t perform that action at this time.
0 commit comments