diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-14 11:06:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-14 11:06:20 -0700 |
commit | 468a55b741f2ceacd8a988a9487db6d767ca8616 (patch) | |
tree | cbf935eda9855db7f9d568b599f7c63246a29399 /actionpack/test/dispatch/live_response_test.rb | |
parent | 7645a5f85d7fc88b5f05f7fe4b73b743078bb069 (diff) | |
parent | 284a9ba8ecbbaac598179af6fc65aed7bcf5785b (diff) | |
download | rails-468a55b741f2ceacd8a988a9487db6d767ca8616.tar.gz rails-468a55b741f2ceacd8a988a9487db6d767ca8616.tar.bz2 rails-468a55b741f2ceacd8a988a9487db6d767ca8616.zip |
Merge pull request #20866 from jdantonio/countdown-latch
Replace `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` from concurrent-ruby.
Diffstat (limited to 'actionpack/test/dispatch/live_response_test.rb')
-rw-r--r-- | actionpack/test/dispatch/live_response_test.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/test/dispatch/live_response_test.rb b/actionpack/test/dispatch/live_response_test.rb index 512f3a8a7a..5cfa5f7b3b 100644 --- a/actionpack/test/dispatch/live_response_test.rb +++ b/actionpack/test/dispatch/live_response_test.rb @@ -1,5 +1,5 @@ require 'abstract_unit' -require 'active_support/concurrency/latch' +require 'concurrent/atomics' module ActionController module Live @@ -27,18 +27,18 @@ module ActionController end def test_parallel - latch = ActiveSupport::Concurrency::Latch.new + latch = Concurrent::CountDownLatch.new t = Thread.new { @response.stream.write 'foo' - latch.await + latch.wait @response.stream.close } @response.await_commit @response.each do |part| assert_equal 'foo', part - latch.release + latch.count_down end assert t.join end @@ -62,15 +62,15 @@ module ActionController def test_headers_cannot_be_written_after_webserver_reads @response.stream.write 'omg' - latch = ActiveSupport::Concurrency::Latch.new + latch = Concurrent::CountDownLatch.new t = Thread.new { @response.stream.each do |chunk| - latch.release + latch.count_down end } - latch.await + latch.wait assert @response.headers.frozen? e = assert_raises(ActionDispatch::IllegalStateError) do @response.headers['Content-Length'] = "zomg" |