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

BacktraceFilter returns nil #837

Closed
lzap opened this issue Mar 6, 2020 · 4 comments
Closed

BacktraceFilter returns nil #837

lzap opened this issue Mar 6, 2020 · 4 comments
Assignees

Comments

@lzap
Copy link

lzap commented Mar 6, 2020

Hey, I am digging in the codebase but I am unable to find why we see exception "NoMethodError: undefined method `split' for nil:NilClass" on this line:

assert_equal nil, nil

There appear to be somehow complex filtering of stacktrace, but it looks like it returns nil for the object on split is called in our environment:

        where = Minitest.filter_backtrace(caller).first
        where = where.split(/:in /, 2).first # clean up noise

The test in question is: https://ci.theforeman.org/job/test_plugin_matrix/1742/database=postgresql,ruby=2.5,slave=fast/console

I am going to fix our test to avoid those nil values, it was a copy and paste error. But creating this ticket in case you can spot what's actually wrong.

@deivid-rodriguez
Copy link

deivid-rodriguez commented Mar 27, 2020

In case it helps, I found this when running mobile-fu tests to package the library for debian, and figured it was an incompatibility with Rails backtrace cleaner. I workarounded it like this, since the BACKTRACE variable is used internally by Rails to avoid backtrace cleaning.

@zenspider
Copy link
Collaborator

If this is a test in rails, then it's probably not my backtrace_filter. If so, please file with rails.

@zenspider zenspider self-assigned this Apr 3, 2020
@lzap
Copy link
Author

lzap commented May 11, 2020

I am not sure I understand the problem and I would be able to articulate in RoR. Thanks for help!

@zenspider
Copy link
Collaborator

I got a fix into rails AND added some defensive coding to minitest to prevent this in the future. Just released too!

zenspider added a commit that referenced this issue May 18, 2020
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix #837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
@minitest minitest locked and limited conversation to collaborators Jan 24, 2021
michaelzedwards added a commit to michaelzedwards/minitest that referenced this issue Feb 10, 2022
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix minitest/minitest#837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
pavelz pushed a commit to pavelz/minitest that referenced this issue May 5, 2024
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix minitest/minitest#837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
pavelz pushed a commit to pavelz/minitest that referenced this issue May 5, 2024
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix minitest/minitest#837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
pavelz pushed a commit to pavelz/minitest that referenced this issue May 5, 2024
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix minitest/minitest#837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
pavelz pushed a commit to pavelz/minitest that referenced this issue May 6, 2024
…s back empty.

+ Minitest::BacktraceFilter now returns entire backtrace if $MT_DEBUG set in env.

This should fix minitest/minitest#837 and
bypasses the need for a release of
rails/rails#39304.

[git-p4: depot-paths = "//src/minitest/dev/": change = 12653]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants