Skip to content

User assert_ractor for test case of Ractor #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Jun 25, 2021

The test-case of Ractor needs to separate the test process use by assert_ractor assertion. I will make it.

But I found a failure of test_ractor of uri library. @kvokka Can you look https://github.com/ruby/uri/runs/2911438018 ?

 #<Thread:0x00007fe5020e32d0 run> terminated with exception (report_on_exception is true):
  | /Users/runner/work/uri/uri/lib/uri/common.rb:75:in `scheme_list': can not access non-shareable objects in constant URI::SCHEME_LIST_MUTEX by non-main ractor. (Ractor::IsolationError)

@hsbt
Copy link
Member Author

hsbt commented Jun 25, 2021

I'm not sure why they fails only macOS.

@eregon
Copy link
Member

eregon commented Jun 25, 2021

FWIW, it seems to work on Linux probably because bundler loads URI and so computes the URI::SCHEMES early, before the Ractor is created.
Adding URI.refresh_scheme_list inside the Ractor.new {} fails reliably, and there is no way to share a Mutex between Ractors.
#26 avoids that issue.

@hsbt hsbt closed this Jun 25, 2021
@hsbt hsbt deleted the assert-ractor branch June 25, 2021 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants