diff options
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 |