tucker19 :
I have a project that we have many Junit tests. We just did a large migration from JUnit4 to JUnit5. We would like to run most of the tests in parallel but have a couple that need to be ran sequentially. Is there any way to use JUnit5 and run tests both ways?
The reason I ask is that I have 4 tests that load a database into memory and I am loading data into this database. Then I run tests on that database. These are the four tests I need to run sequentially and cannot run in parallel.
Imre L :
You most likely want to use @ResourceLock
annotation on tests https://junit.org/junit5/docs/snapshot/user-guide/#writing-tests-parallel-execution-synchronization