[#11700] Getting randomly failing test in ActionController::Live to pass on JRuby

Hello Rubyists,
As part of issue #11700, I am trying to get all failing tests to run & pass on JRuby. I have solved some issues & got almost all tests green. but there is this async stream test[1] which I have trouble debugging. to run this, just copy-paste following commands[2], assuming you are using rvm.

This test hangs on ActionController::Live:Response. My guess, its due the fact MRI has GIL/GVL & JRuby is truly multi-threaded. so looking for for some assistance on debugging this issue or general advice on how to approach threading issues. so we could get this code to work correctly on JRuby. Thanks

Regards,
Gaurish Sharma

PS: Its possible that if you run this test, it just passes fine. in which case, run is multiple times until you get a failure. This random behaviour is what makes debugging threading issues hard.

[1] https://github.com/rails/rails/blob/master/actionpack/test/controller/live_stream_test.rb#L208-L227

[2] https://gist.github.com/gaurish/7386298