Skip to content
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

Test suite hangs with Ruby 3.4 #357

Open
simpl1g opened this issue Nov 14, 2024 · 1 comment
Open

Test suite hangs with Ruby 3.4 #357

simpl1g opened this issue Nov 14, 2024 · 1 comment

Comments

@simpl1g
Copy link
Contributor

simpl1g commented Nov 14, 2024

It's continuation of this PR #356

Currently Ruby process can't finish after all tests passed. I've dumped all thread backtraces and it shows

/Users/simpl1g/.rbenv/versions/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/ffi-rzmq-2.0.7/lib/ffi-rzmq/device.rb:24:in 'LibZMQ.zmq_proxy'
/Users/simpl1g/.rbenv/versions/3.4.0-preview2/lib/ruby/gems/3.4.0+0/gems/ffi-rzmq-2.0.7/lib/ffi-rzmq/device.rb:24:in 'ZMQ::Device#initialize'
/Users/simpl1g/work/ruby_projects/iruby/lib/iruby/session_adapter/ffirzmq_adapter.rb:29:in 'Class#new'
/Users/simpl1g/work/ruby_projects/iruby/lib/iruby/session_adapter/ffirzmq_adapter.rb:29:in 'IRuby::SessionAdapter::FfirzmqAdapter#heartbeat_loop'
/Users/simpl1g/work/ruby_projects/iruby/lib/iruby/session.rb:55:in 'block in IRuby::Session#setup_heartbeat'

So it looks like a problem in ffi-rzmq gem. If I comment out creating heartbeat thread all tests passes and process completes fine. But I'm not sure that this is correct way to do this :)

@kojix2
Copy link
Member

kojix2 commented Feb 4, 2025

Ruby committer @tompng looked into this issue on slack-jp and found that the problem is most likely related to ffi-rzmq. Thanks tompng!

Image

Here is the English translation of the text in the image ( ChatGPT) :


koji×2 (January 25, 19:40)

This might not be the right place to ask, but in Ruby 3.4, when running tests in IRuby (the Jupyter Notebook Ruby kernel), the tests seem to pass, yet they still fail due to a timeout. Does anyone have any ideas?

[GitHub Actions link](https://github.com/SciRuby/iruby/actions/runs/12941938897/job/36098818328)


tompng (January 25, 20:41)

That's a mystery.

When setting IRUBY_TEST_SESSION_ADAPTER_NAME=ffi-rzmq and running

  • session_test.rb (only running test_new_with_session_adapter)
  • run-test.rb

It seems to get stuck at this point:

exit Test::Unit::AutoRunner.run(true, test_dir)

It looks like exit is executed, but for some reason, it doesn't actually exit.


tompng (January 25, 21:18)

If you execute:

IRuby::Session.new(session_config, 'ffi-rzmq'); exit

the script never stops.

It seems like zmq_context has a terminate method, but calling it does nothing, and it just waits indefinitely. I feel like executing terminate right before exit might resolve the issue.

(However, I don't know if this behavior changes between versions 3.4 and 3.3.)


koji×2 (January 25, 21:38)

Thank you very much! That helps a lot!


tompng (January 25, 22:27)

At this point, I’ll step aside. Good luck.


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

No branches or pull requests

2 participants