Closed
Description
Steps to reproduce
Test like this causes ThreadError: already initialized
after updating Ruby 2.6.0.
class EmployeesControllerTest < ActionController::TestCase
def test_list_markup
get :list
assert_response(:success)
end
...
end
EmployeesControllerTest#test_edit_markup:
ThreadError: already initialized
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/2.6.0/monitor.rb:259:in `mon_initialize'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/2.6.0/monitor.rb:252:in `initialize'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-4.2.11/lib/action_dispatch/http/response.rb:119:in `initialize'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-4.2.11/lib/action_controller/test_case.rb:277:in `recycle!'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-4.2.11/lib/action_controller/test_case.rb:617:in `process'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-4.2.11/lib/action_controller/test_case.rb:67:in `process'
/home/shirosaki/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/actionpack-4.2.11/lib/action_controller/test_case.rb:514:in `get'
/home/shirosaki/work/master/test/functional/employees_controller_test.rb:24:in `test_edit_markup'
Expected behavior
Not raise ThreadError.
Actual behavior
Raise ThreadError.
System configuration
Rails version:
4.2.11
Ruby version:
2.6.0
The error would be related to this issue.
https://bugs.ruby-lang.org/issues/15000
If I remove raise ThreadError, "already initialized"
in lib/monitor.rb
, tests pass.