diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-14 23:04:42 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-18 23:29:51 -0700 |
commit | 3ba0eec20c79923ee701b13f297cc21a6f0f4a9b (patch) | |
tree | d984b35cb3b53e4279ae213e95d14e524c0f2daf /actioncable/test/test_helper.rb | |
parent | 7ad4690b2149fbb23faa179c21698b92ff383c73 (diff) | |
download | rails-3ba0eec20c79923ee701b13f297cc21a6f0f4a9b.tar.gz rails-3ba0eec20c79923ee701b13f297cc21a6f0f4a9b.tar.bz2 rails-3ba0eec20c79923ee701b13f297cc21a6f0f4a9b.zip |
Cable: Extract stream handler construction
* Use separate stream handler builders for easy override and testing.
* Fix worker pool execution that was silently failing since it only
expected connection receivers.
Sparked by code in #24162.
Diffstat (limited to 'actioncable/test/test_helper.rb')
-rw-r--r-- | actioncable/test/test_helper.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/actioncable/test/test_helper.rb b/actioncable/test/test_helper.rb index de1ee96770..0a9ee7ce77 100644 --- a/actioncable/test/test_helper.rb +++ b/actioncable/test/test_helper.rb @@ -49,10 +49,7 @@ end module ConcurrentRubyConcurrencyHelpers def wait_for_async - e = Concurrent.global_io_executor - until e.completed_task_count == e.scheduled_task_count - sleep 0.1 - end + wait_for_executor Concurrent.global_io_executor end def run_in_eventmachine @@ -67,4 +64,10 @@ class ActionCable::TestCase < ActiveSupport::TestCase else include ConcurrentRubyConcurrencyHelpers end + + def wait_for_executor(executor) + until executor.completed_task_count == executor.scheduled_task_count + sleep 0.1 + end + end end |