From b5e36dd00a6feedb79cf84b921a04ce80172b6f4 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 23 Sep 2015 15:59:32 -0700 Subject: [PATCH] don't touch the response object until after we call `get` --- actionpack/test/controller/live_stream_test.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb index e9c19b7acf..94888cb125 100644 --- a/actionpack/test/controller/live_stream_test.rb +++ b/actionpack/test/controller/live_stream_test.rb @@ -281,10 +281,9 @@ def test_async_stream @controller.latch = Concurrent::CountDownLatch.new parts = ['hello', 'world'] - @controller.request = @request - @controller.response = @response + get :blocking_stream - t = Thread.new(@response) { |resp| + t = Thread.new(response) { |resp| resp.await_commit resp.stream.each do |part| assert_equal parts.shift, part @@ -294,8 +293,6 @@ def test_async_stream end } - @controller.process :blocking_stream - assert t.join(3), 'timeout expired before the thread terminated' end -- GitLab