✅ Fix JRuby local backtrace test assertions - #732
Open
nevans wants to merge 1 commit into
Open
Conversation
A bug was fixed in jruby-head, but that may not be in current releases: * JRuby Issue: jruby/jruby#9528 * Fixed by: jruby/jruby#9528 With that issue fixed, these tests don't need to be marked pending! 😄 BUT, JRuby _does_ still have some incongruity between `caller(1)` and `raise rescue $!.backtrace[1..]`. Some ruby block stack frames in `caller` are replaced by java stack frames in `Exception#backtrace`. For example: ```diff --- Kernel#caller +++ Exception#backtrace /home/nick/.local/share/rubies/jruby-dev/lib/ruby/gems/shared/gems/test-unit-3.7.8/lib/test/unit/testcase.rb:632:in 'block in run' - /home/nick/.local/share/rubies/jruby-dev/lib/ruby/gems/shared/gems/test-unit-3.7.8/lib/test/unit/testcase.rb:631:in 'catch' + org/jruby/RubyKernel.java:1604:in 'catch' + org/jruby/RubyKernel.java:1599:in 'catch' /home/nick/.local/share/rubies/jruby-dev/lib/ruby/gems/shared/gems/test-unit-3.7.8/lib/test/unit/testcase.rb:631:in 'run' ``` The workaround is relatively simple: use a locally generated exception to generate the stack frames for comparison.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A bug was fixed in jruby-head, but that may not be in current releases:
With that issue fixed, these tests don't need to be marked pending! 😄
BUT, JRuby does still have some incongruity between
caller(1)andraise rescue $!.backtrace[1..]. Some ruby block stack frames incallerare replaced by java stack frames inException#backtrace. For example:The workaround is relatively simple: use a locally generated exception to generate the stack frames for comparison.