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/fiber/test_queue.rb: Make the stuck test fail. #8791
test/fiber/test_queue.rb: Make the stuck test fail. #8791
Conversation
Thanks for working on this. I don't think using If you want to limit the thread join, provide an argument to join, e.g. thread = Thread.new{...}
kill_count = 0
until thread.join(2) # 2 seconds maximum timeout until we kill it.
kill_count += 1
thread.kill
end
assert(kill_count, 0) I hope we can figure out a better way to fail the test if the thread is killed. |
OK. Thanks for review. I will modify on your suggested way. |
I thought a boolean variable is better than number variable |
2b5f63c
to
1611261
Compare
I rebased the PR on your way. I used the boolean value
|
Travis CI ppc64le is failing with another issue. This is not related to this PR.
But I noticed the ppc64le job finished with total time 14:08. It is really faster than the current master's time 21:59. Perhaps this PR's change affected it? |
Maybe I think the |
We observed the 2 tests in the `test/fiber/test_queue.rb` getting stuck in some GCC compilers in Ubuntu ppc64le focal/jammy, even when the timeout `queue.pop(timeout: 0.0001)` is set in the code. This commit is to make the tests fail rather than getting stuck.
1611261
to
bb1c33e
Compare
OK. Now rebased with
|
This PR may fix the stuck/hang: #8393 - do you want to try applying it and see if it helps? |
I don't understand what your idea is. Could you explain more about it? |
It causes the compiler to generate different code which doesn't hang. I don't know if the mutex code path is used for queue but it may be. |
OK. Maybe I understood your idea. The PR #8393 is an implementation to fix stuck/hang. However, we don't know if implementation is used for Yes, I think so. That's a good idea. Because while we avoid the stuck/hang to the tests in I don't want to do it by myself. It's great if you do it. You have a reproducer to test stuck/hang in RubyCI ppc64le server. I am going to merge this PR now. I think keeping this PR's assertion in the test is still useful even after you implement for the Thanks for your review! |
That all seems reasonable to me. |
test/fiber/test_queue.rb: Make the stuck test fail. (#8791) test/fiber/test_queue.rb: Make the stuck tests fail. We observed the 2 tests in the `test/fiber/test_queue.rb` getting stuck in some GCC compilers in Ubuntu ppc64le focal/jammy, even when the timeout `queue.pop(timeout: 0.0001)` is set in the code. This commit is to make the tests fail rather than getting stuck. --- test/fiber/test_queue.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
This PR is to make the stuck tests fail immediately in a better way.
I observed the 2 tests in the
test/fiber/test_queue.rb
getting stuck in some GCC compilers in ppc64le Ubuntu, even when the timeoutqueue.pop(timeout: 0.0001)
is set in the code. This commit is to make the test fail rather than getting stuck.The issue can happen in the current RubyCI ppc64le server with GCC 11.4.0. We also observed the issue an older GCC compiler in the past in Ubuntu focal ppc64le.
#8739 (comment)
Here is the reproducer for the issue.
https://github.com/junaruga/report-ruby-fiber-hung_up-tests
After applying this PR, when the test hit the issue, the result is below. I checked it on RubyCI ppc64le server.