Open maximkovalenko-hc opened 1 week ago
Are you sure that your Mockito version resolves to 5.14.2? We haven't made changes in this minor version compared to the previous ones.
Yes, I can confirm that it's reproduced under the version 5.14.2
It might have been done in 5.14.0, PR https://github.com/mockito/mockito/pull/3437/files#diff-dc8b58b0826ca3b51eee39cb3066094b326a7fd2a3d55e492b25e7dea4ab1ad7
Maybe it should not be shown in case -XX:+EnableDynamicAgentLoading
is used?
Also, it is worth mentioning that explicit agent solution suggested by https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.3 for the Maven builds does not work under this set-up and with Surefire plugin 3.5.2
# Created at 2024-11-20T11:20:16.299
Corrupted channel by directly writing to native stream in forked JVM 1. Stream 'Error occurred during initialization of VM'.
# Created at 2024-11-20T11:20:16.300
Corrupted channel by directly writing to native stream in forked JVM 1. Stream 'agent library failed Agent_OnLoad: instrument'.
I can look into resolving the XX options. However, the warning is there for a reason. Your builds will start failing with Java 22+, so you unfortunately need to adjust your test plugin configuration.
I added a change that would suppress the option if -XX:+EnableDynamicAgentLoading
is enabled. The :spotlessApply target seems to have disappeared, @TimvdLippe?
Might have been broken by the recent build refactorings @bric3 ?
Hi, not broken but moved!
In gradle terms :
is the root project, and mockito core code base used to be in the root project, now it's in mockito-core
which is referred to as :mockito-core
. And since the root project has no more code there's not anymore spotless tasks. In practice that means:
If you want to apply to mockito-core
, use
./gradlew :mockito-core:spotlessApply
If you just want to execute spotless apply in any submodule, use
./gradlew spotlessApply
Note the lack of leading :
which indicates the task will be searched in all projects.
Indeed, thanks. I just ran a command from my console history and fell over that.
Using
mockito-core:5.14.2
andspring-boot:3.3.5
shows this warning:However the previous versions of mockito (5.13.0, 5.12.0, 5.11.0...) don't have it.
Can we run the latest version of mockito without "Mockito is currently self-attaching..." warning?
More details: mockito-core:5.14.2 mockito-junit-jupiter:5.14.2 spring-boot:3.3.5 Oracle GraalVM 21.0.5+9.1