From c285bbec17e845c2d5efca55c510983f6cc9456c Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 23 Oct 2015 14:33:33 +0800 Subject: FIX: Randomly failing test when running without GIL. --- actionpack/test/controller/live_stream_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack') diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb index 4d1c23cbee..4224ac2a1b 100644 --- a/actionpack/test/controller/live_stream_test.rb +++ b/actionpack/test/controller/live_stream_test.rb @@ -388,8 +388,14 @@ module ActionController end def test_exception_callback_when_committed + current_threads = Thread.list + capture_log_output do |output| get :exception_with_callback, format: 'text/event-stream' + + # Wait on the execution of all threads + (Thread.list - current_threads).each(&:join) + assert_equal %(data: "500 Internal Server Error"\n\n), response.body assert_match 'An exception occurred...', output.rewind && output.read assert_stream_closed -- cgit v1.2.3