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
azure-sdk-for-ruby tests hanging in Ruby v2.0.0, v2.1.5, v2.2.0, v2.3.0 #276
Comments
A simpler way to get an appropriate version of the azure-sdk-for-ruby code to reproduce the problem is to checkout the asm branch rather than the specific commit SHA that I suggested in my previous comment. |
I used GDB to generate a Ruby backtrace at the point where the tests were hanging. The test is hanging in the subject block on line 21. The problem seems to be related to line 413 of the test where all the private instance methods of the subject class, I can stop the tests from hanging by any one of the following:
Although the test should not be hanging, line 413 of the test seems like a really dangerous thing to do, because it makes all of the private methods public for all tests after that point. This is because the class is effectively a global variable and so you are not protected by the tests creating a new instance each time. @sarangan12: I will continue to investigate why the test is hanging, but in the meantime, I'd suggest you work around the problem by using one of my suggestions above. |
I've now narrowed the problem down to the simplest scenario: module Foo
end
class Bar
prepend Foo
public :initialize
end
p Bar.new # => hangs
I have created a Ruby bug report for the issue. I'm not sure that there is much we can do in Mocha other than reverting back to not using a prepended module for stubbing. @chrisroos: Do you have any thoughts? |
The bug in Ruby has been fixed and released in Ruby v2.4.0 and back-ported & released in Ruby v2.3.3. |
See #276 and the Ruby bug report [1] for more details. [1]: https://bugs.ruby-lang.org/issues/12876
I've added a known issue to the Mocha README. I don't think there's anything else to do here, so I'm going to close this issue. |
This was originally reported by @sarangan12 in #272 (comment). However, I'm not convinced it's the same problem as was originally reported in #272, because in this case I can use ctrl-C to abort the tests. In #272, I had to use ctrl-Z and manually kill the process.
It doesn't look as if the code which caused the build failures exists any more, but I think I've been able to reproduce the problem as follows:
rbenv local 2.3.0
git clone git@github.com:Azure/azure-sdk-for-ruby.git
git checkout b1314c7b0c6ece809d979dc6d83abf0d62af3419
azure.gemspec
to~> 1.0
bundle install
The text was updated successfully, but these errors were encountered: