Skip to content

Performance issue with JUnit5 Jupiter (MockitoExtension) #1410

Description

@jibidus

Hi Mockito team,

I noticed performance issue when migrating my JUnit5 Vintage tests to JUnit5 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) and org.junit.Test, whereas Jupter tests are written with @ExtendWith(MockitoExtension.class) and org.junit.jupiter.api.Test (with same codebase).

Stack:

  • JUnit 5.2.0
  • Mockito 2.19.0
  • Java 1.8u172
  • MacOS

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions