Skip to content

Commit

Permalink
Fix spec timing
Browse files Browse the repository at this point in the history
  • Loading branch information
pitr-ch committed Mar 10, 2019
1 parent 04e9390 commit d84d13e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions spec/concurrent/edge/erlang_actor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,12 @@
body = { on_thread:
-> do
spawn(link: true) { raise 'err' }
receive(timeout: 0.01)
receive(timeout: 1)
end,
on_pool:
-> do
spawn(link: true) { raise 'err' }
receive(on(ANY) { |v| [v, b] },
on(TIMEOUT) { |v| [nil, b] },
timeout: 0.01)
receive(timeout: 1) { |v| v }
end }

a = Concurrent::ErlangActor.spawn(type: type, &body.fetch(type))
Expand Down Expand Up @@ -534,15 +532,15 @@
-> do
b = spawn(link: true) { throw :uncaught }
trap
[receive(timeout: 0.01), b]
[receive(timeout: 1), b]
end,
on_pool:
-> do
b = spawn(link: true) { throw :uncaught }
trap
receive(on(ANY) { |v| [v, b] },
on(TIMEOUT) { |v| [nil, b] },
timeout: 0.01)
timeout: 1)
end }

a = Concurrent::ErlangActor.spawn(type: type, &body.fetch(type))
Expand Down

0 comments on commit d84d13e

Please sign in to comment.