test: use Test::Unit::TestCase.ractor
Instead of using assert_separately. If we use .ractor, we can use the same process for tests that use Ractor. It's easy to debug.
Can we use this feature on ruby/ruby repo? If It's No, we skip this test at ruby/ruby repo.
I'm happy to port this feature to https://github.com/ruby/ruby/blob/master/tool/lib/test/unit/testcase.rb
Can we use this feature on
ruby/rubyrepo?
No.
If It's No, we skip this test at
ruby/rubyrepo.
Right.
I'm happy to port this feature to https://github.com/ruby/ruby/blob/master/tool/lib/test/unit/testcase.rb
Thanks.
We just need to run tests that use Ractor after other tests that don't use Ractor.
The ractor method just mark tests that use Ractor.
I'm happy to port this feature to https://github.com/ruby/ruby/blob/master/tool/lib/test/unit/testcase.rb
Thanks. We just need to run tests that use Ractor after other tests that don't use Ractor. The
ractormethod just mark tests that use Ractor.
ruby/ruby's test runs per classes, or per files in parallel mode.
It doesn't seem a trivial change to split test cases per methods, unfortunately.
core_assertions.rb defines assert_ractor, that is similar to assert_separately but suppress the Ractor warning first.
This PR removes $VERBOSE = nil, and it will show the warning?
https://github.com/ruby/pathname/actions/runs/8895915304/job/24427357987?pr=38#step:5:20
/home/runner/work/pathname/pathname/test/pathname/test_ractor.rb:9: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
I think that we don't need to suppress the Ractor warning. So test-unit doesn't suppress the warning automatically. If we should suppress the Ractor warning, I'll do it in test-unit.
Well, it would be a preference matter, like as test-unit shows omit messages by default, while ruby/ruby not.
Also it's because assert_ractor would be too noisy unless suppressing the warning, since it runs a process for each assertion.
I see.
test-unit shows omit messages by default but doesn't show such messages by default on GitHub Actions:
https://github.com/test-unit/test-unit/blob/d4183f6688fa8bc83566224aaaf66c51f8434bae/lib/test/unit/ui/console/testrunner.rb#L538-L539
So I'll change test-unit to suppress the Ractor warning by default on GitHub Actions.