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

Under JRuby Capybara is hanging with default server (Puma) at the end of test suite #2762

Open
dolzenko opened this issue Apr 30, 2024 · 0 comments

Comments

@dolzenko
Copy link

Simple repro Rails 7 app attached [1]. The idea is that after doing

bin/rails test:system

the process never finishes after printing

Finished in 1.972128s, 0.5071 runs/s, 0.5071 assertions/s.
1 runs, 1 assertions, 0 failures, 1 errors, 0 skips

I firmly believe this is happening because when JRuby tries to kill/join the Puma reactor thread at shutdown [2], but being stuck in epollWait Puma thread won't die. With simple patch [3] it works on JRuby 9.3 but gives NullPointerException on 9.4 so it's just for illustration of the idea that Puma server should be probably shutdown in some specific way.

I'm also undecided if that should be reported to JRuby/Puma or here so suggestions welcome.

[1] https://github.com/dolzenko/capybara-puma-hanging-repro
[2] https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/internal/runtime/ThreadService.java#L158
[3] master...dolzenko:capybara:patch-2

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

1 participant