Skip to content

Commit

Permalink
Merge pull request rails#22038 from tgxworld/fix_random_error_when_ru…
Browse files Browse the repository at this point in the history
…nning_tests_with_jruby

FIX: Randomly failing test when running without GIL.
  • Loading branch information
kaspth committed Oct 23, 2015
2 parents e817196 + c285bbe commit 6f62ace
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions actionpack/test/controller/live_stream_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,14 @@ def test_exception_handling_plain_text
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
Expand Down

0 comments on commit 6f62ace

Please sign in to comment.