mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22038 from tgxworld/fix_random_error_when_running_tests_with_jruby
FIX: Randomly failing test when running without GIL.
This commit is contained in:
commit
6f62ace65a
1 changed files with 6 additions and 0 deletions
|
@ -388,8 +388,14 @@ module ActionController
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_exception_callback_when_committed
|
def test_exception_callback_when_committed
|
||||||
|
current_threads = Thread.list
|
||||||
|
|
||||||
capture_log_output do |output|
|
capture_log_output do |output|
|
||||||
get :exception_with_callback, format: 'text/event-stream'
|
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_equal %(data: "500 Internal Server Error"\n\n), response.body
|
||||||
assert_match 'An exception occurred...', output.rewind && output.read
|
assert_match 'An exception occurred...', output.rewind && output.read
|
||||||
assert_stream_closed
|
assert_stream_closed
|
||||||
|
|
Loading…
Reference in a new issue