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
NullPointerException in ClassMethodNameStackTraceSpec (related to Java test tasks and minGranularity) #12187
Comments
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This is still an issue in Gradle 6.8.3. I'm hoping to find the time to put together a PR to address this. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to to let know so we can reopen the issue. Please try to provide steps to reproduce, a quick explanation of your use case or a high-quality pull request. |
@wolfs , the issue is still relevant. Would you please reopen it? Here's a reproducer: #23268 (comment) + add |
Thank you for providing a valid reproducer. The issue is in the backlog of the relevant team but this area of Gradle is currently not a focus one so it might take a while before a fix is made. |
Expected Behavior
I encountered this NPE while experimenting with JUnit 5. (This was in a proprietary repo; public repro here.) It happens in exception-processing code, and appears to prevent the actual exception and stacktrace from making its way to the user.
I only see this when testLogging is modified to set minGranularity to 0.
Current Behavior
When running a project's test task with
--stacktrace
(in Gradle 6.1.1), I get the following:By running Gradle from source and adding some logging, I see the following:
Gradle Test Executor 6
) and an exception with the following stacktrace (a correct and helpful description of what I was doing):TRUNCATE
path and creates a ClassMethodNameStackTraceSpec with the null class name.@Nullable
in its constructor, unlike its other argument, and doesn't account for its nullability in classNameMatch(). This results in the NPE.I suspect FullExceptionFormatter#createFilter should change to account for the case where className is null, or perhaps the output of testLogging.getStackTraceFilters() in FullExceptionFormatter#createCompositeFilter should change.
Oddly, running with
--info
doesn't seem to have this problem (and might not be hitting the same code paths I mentioned above).(This was previously filed as #12157, before I learned more about the issue.)
Your Environment
Gradle 6.1.1
Azul Zulu Java 8
MacOS
The text was updated successfully, but these errors were encountered: