You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite trying, I unfortunately was not able to come up with a way to reproduce this outside of our project.
Context
Used versions (Jupiter/Vintage/Platform): org.junit.jupiter:junit-jupiter:5.11.4
Build Tool/IDE: Gradle 8.12 + IntelliJ
Java 21.0.3
Hello,
We have a project with thousands of unit tests. We are looking into speeding up their execution by enabling parallelization of the unit tests with this feature from JUnit5:
However, a lot of tests become flaky when we do that. And we noticed it's because any class that uses a org.slf4j.Logger instance may end with their logger set to null:
Cannot invoke "org.slf4j.Logger.warn(String)" because "com.example.Foobar.log" is null
java.lang.NullPointerException: Cannot invoke "org.slf4j.Logger.warn(String)" because "com.example.Foobar.log" is null
The issue happens even when using a trivial logging implementation, slf4j-nop. The tests run fine when not parallelized.
According to qos-ch/slf4j#449 (comment), the suspected root cause is in commons-logging. We're not doing anything in JUnit that would mess with class initialization.
Steps to reproduce
Despite trying, I unfortunately was not able to come up with a way to reproduce this outside of our project.
Context
org.junit.jupiter:junit-jupiter:5.11.4
Hello,
We have a project with thousands of unit tests. We are looking into speeding up their execution by enabling parallelization of the unit tests with this feature from JUnit5:
However, a lot of tests become flaky when we do that. And we noticed it's because any class that uses a
org.slf4j.Logger
instance may end with their logger set to null:The issue happens even when using a trivial logging implementation,
slf4j-nop
. The tests run fine when not parallelized.Linking this to qos-ch/slf4j#449
The text was updated successfully, but these errors were encountered: