-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Performance issue with JUnit5 Jupiter (MockitoExtension) #1410
Comments
you may try with versions updates: |
If you mean dependencies {
def junit4Version = '4.12'
def junitVintageVersion = '5.2.0'
def junitJupiterVersion = '5.2.0'
def junitPlatformVersion = '1.2.0'
// JUnit ------------------------------------------------------------------
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testCompile("junit:junit:${junit4Version}")
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") {
because 'allows tests to run from IDEs that bundle older version of launcher'
}
def mockitoVersion = '2.19.0'
// Mockito ----------------------------------------------------------------
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
testImplementation "org.mockito:mockito-junit-jupiter:${mockitoVersion}"
} If not, please let me know which artefact can be upgraded. |
@raphw 2.19.0 is our latest version. Did that include your perf improvements on bytebuddy or are you still working on that? |
ℹ️ I just upgraded
|
Hi Mockito team,
I noticed performance issue when migrating my
JUnit5 Vintage
tests toJUnit5 Jupiter
.You can find a small project which illustrates this behavior
To sum up, with a dummy test class, when
Vintage
tests take about 10ms, first Jupiter test took about 700ms, and next to follow 20ms.Vintage
tests are written with@RunWith(MockitoJUnitRunner.class)
andorg.junit.Test
, whereasJupter
tests are written with@ExtendWith(MockitoExtension.class)
andorg.junit.jupiter.api.Test
(with same codebase).Stack:
Thanks for your help.
The text was updated successfully, but these errors were encountered: