aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/live_response_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/live_response_test.rb')
-rw-r--r--actionpack/test/dispatch/live_response_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/test/dispatch/live_response_test.rb b/actionpack/test/dispatch/live_response_test.rb
index 5cfa5f7b3b..160cdc1582 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 'concurrent/atomics'
+require 'concurrent/atomic/count_down_latch'
module ActionController
module Live
@@ -65,7 +65,7 @@ module ActionController
latch = Concurrent::CountDownLatch.new
t = Thread.new {
- @response.stream.each do |chunk|
+ @response.stream.each do
latch.count_down
end
}
@@ -83,6 +83,8 @@ module ActionController
def test_headers_cannot_be_written_after_close
@response.stream.close
+ # we can add data until it's actually written, which happens on `each`
+ @response.each { |x| }
e = assert_raises(ActionDispatch::IllegalStateError) do
@response.headers['Content-Length'] = "zomg"