#58736·rails

FileSystemResolverRactorTest#test_non-strict_templates_compile_inside_a_non-main_Ractor errors on Ruby master (Feature #22226)

Author: yahondaCreated Sep 11, 2026Updated Sep 11, 2026
Labelsactionviewci issuesRactor Support

rails-nightly build 4720 (rails/rails@faec9ab69d, 2026-09-10) errors in all three actionview jobs (master, yjit, master-debug) on FileSystemResolverRactorTest#test_non-strict_templates_compile_inside_a_non-main_Ractor with Ractor::IsolationError: can not modify FileSystemResolverRactorTest::FakeView because it is created by another Ractor: https://buildkite.com/rails/rails-nightly/builds/4720#01a08d1f-067e-4788-a16c-943374493f9f

Build 4717 the day before passed: https://buildkite.com/rails/rails-nightly/builds/4717#01a087f8-a1f4-4ffc-bb38-086f5df6a2f5

The Ruby master image moved from 6d15e7be7c (2026-09-09) to 3742091090 (2026-09-10), which includes the class/module ownership change of Feature #22226 (ruby/ruby@2e5bf429e4 and the commits merged with it).

The Ruby change is the intended behavior of an accepted feature (documented in NEWS), and the Ractor support in Rails that it affects is main-only and under active development, so this is reported here rather than to the Ruby bug tracker.

Steps to reproduce

Run the Action View test suite on Ruby master at or after ruby/ruby@2e5bf429e4:

cd actionview
bin/test test/template/file_system_resolver_test.rb -n test_non-strict_templates_compile_inside_a_non-main_Ractor

Expected behavior

The test passes: a non-strict template of a frozen resolver renders inside a non-main Ractor, as it does on ruby/ruby@3f2e84dd36, the parent of 2e5bf429e4:

$ ruby -v
ruby 4.1.0dev (2026-09-10T07:02:03Z master 3f2e84dd36) +PRISM [x86_64-linux]
$ bin/test test/template/file_system_resolver_test.rb -n test_non-strict_templates_compile_inside_a_non-main_Ractor
Please switch from -n/--name to -i/--include
Running 31 tests in a single process (parallelization threshold is 50)
Run options: -n test_non-strict_templates_compile_inside_a_non-main_Ractor --seed 3230

# Running:

.

Finished in 0.049370s, 20.2552 runs/s, 20.2552 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips

Actual behavior

$ bin/test test/template/file_system_resolver_test.rb -n test_non-strict_templates_compile_inside_a_non-main_Ractor
Please switch from -n/--name to -i/--include
Running 31 tests in a single process (parallelization threshold is 50)
Run options: -n test_non-strict_templates_compile_inside_a_non-main_Ractor --seed 8368

# Running:

#<Thread:0x0000735426ed0010 run> terminated with exception (report_on_exception is true):
/tmp/d20260911-339297-khy14c/test/_card.html.erb:in 'ActionView::Template#compile': can not modify FileSystemResolverRactorTest::FakeView because it is created by another Ractor (Ractor::IsolationError)
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:555:in 'Module#module_eval'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:555:in 'ActionView::Template#compile'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:485:in 'block (2 levels) in ActionView::Template#compile!'
        from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:274:in 'ActiveSupport::Notifications.instrument'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:632:in 'ActionView::Template#instrument'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:484:in 'block in ActionView::Template#compile!'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:476:in 'Thread::Mutex#synchronize'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:476:in 'ActionView::Template#compile!'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:294:in 'block in ActionView::Template#render'
        from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:274:in 'ActiveSupport::Notifications.instrument'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:636:in 'ActionView::Template#instrument_render_template'
        from /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:293:in 'ActionView::Template#render'
        from /home/yahonda/src/github.com/rails/rails/actionview/test/template/file_system_resolver_test.rb:173:in 'block (3 levels) in <class:FileSystemResolverRactorTest>'
        from /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/ractors_assertions.rb:15:in 'block in ActiveSupport::Testing::RactorsAssertions#on_ractor'
E

Error:
FileSystemResolverRactorTest#test_non-strict_templates_compile_inside_a_non-main_Ractor:
Ractor::RemoteError: thrown by remote Ractor.
    /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/ractors_assertions.rb:16:in 'Ractor#join'
    /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/testing/ractors_assertions.rb:16:in 'ActiveSupport::Testing::RactorsAssertions#on_ractor'
    test/template/file_system_resolver_test.rb:170:in 'block (2 levels) in <class:FileSystemResolverRactorTest>'
    /home/yahonda/.local/share/mise/installs/ruby/trunk/lib/ruby/4.1.0+4/tmpdir.rb:105:in 'Dir.mktmpdir'
    test/template/file_system_resolver_test.rb:154:in 'block in <class:FileSystemResolverRactorTest>'


bin/test test/template/file_system_resolver_test.rb:153



Finished in 0.053309s, 18.7586 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips

System configuration

Rails version: main (rails/rails@4ec2d5d2c2)

Ruby version:

$ ruby -v
ruby 4.1.0dev (2026-09-10T07:02:03Z master 2e5bf429e4) +PRISM [x86_64-linux]

Additional information

The Ruby side reduces to defining a method on a class the main Ractor created:

class C; end
Ractor.new { C.module_eval("def m; end") }.value