diff options
author | palkan <dementiev.vm@gmail.com> | 2016-09-19 12:29:23 +0300 |
---|---|---|
committer | palkan <dementiev.vm@gmail.com> | 2016-09-20 19:42:24 +0300 |
commit | 03a209e92aeed1e724b3ff787ec77936b7163ca5 (patch) | |
tree | cba7736f79df8686f1906ed7d9316c00afd02c97 /actioncable/test/test_helper.rb | |
parent | 254db4987d03d3c9d3fca1e2961da8fd7dd0e06b (diff) | |
download | rails-03a209e92aeed1e724b3ff787ec77936b7163ca5.tar.gz rails-03a209e92aeed1e724b3ff787ec77936b7163ca5.tar.bz2 rails-03a209e92aeed1e724b3ff787ec77936b7163ca5.zip |
[Fix #25381] Avoid race condition on subscription confirmation
Diffstat (limited to 'actioncable/test/test_helper.rb')
-rw-r--r-- | actioncable/test/test_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actioncable/test/test_helper.rb b/actioncable/test/test_helper.rb index 39855ea252..af3c7eee1d 100644 --- a/actioncable/test/test_helper.rb +++ b/actioncable/test/test_helper.rb @@ -66,8 +66,12 @@ class ActionCable::TestCase < ActiveSupport::TestCase end def wait_for_executor(executor) + # do not wait forever, wait 2s + timeout = 2 until executor.completed_task_count == executor.scheduled_task_count sleep 0.1 + timeout -= 0.1 + raise "Executor could not complete all tasks in 2 seconds" unless timeout > 0 end end end |