Skip to content

TestClassOrder does not play nicely with @RepeatedTest #4171

@roded

Description

@roded

Seems like TestClassOrder does not play nicely with @RepeatedTest.

Steps to reproduce

The following results in out of order test execution. I expected all writeTest repetitions to execute before all readTest executions.

Replacing @RepeatedTest with @Test works though.

@TestClassOrder(ClassOrderer.OrderAnnotation.class)
public class RodedIcegenerStressCdsTest {

    @Nested
    @Order(2)
    public class ReadScenarioStressTests {

        // @Test
        @RepeatedTest(10)
        public void readTest() {
            System.out.println("read");
        }
    }

    @Nested
    @Order(1)
    public class WriteScenarioStressTests {

        // @Test
        @RepeatedTest(10)
        public void writeTest() {
            System.out.println("write");
        }
    }
}

Log:

10:04:22.791 INFO  [o.j.j.e.c.EnumConfigurationParameterConverter-ForkJoinPool-1-worker-1] - Using parallel execution mode 'CONCURRENT' set via the 'junit.jupiter.execution.parallel.mode.default' configuration parameter.
read
read
write
write
write
read
read
read
read
read
write
write
write
write
read
write
write
read
write
read

Context

JUnit version: 5.11.3
Running via Gradle on IntelliJ.

    systemProperty("junit.jupiter.execution.parallel.enabled", "true")
    systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
    systemProperty("junit.jupiter.execution.parallel.mode.classes.default", "concurrent")
    systemProperty("junit.jupiter.extensions.autodetection.enabled", "true")
    systemProperty("junit.jupiter.execution.parallel.config.strategy", "fixed")
    systemProperty("junit.jupiter.execution.parallel.config.fixed.parallelism", 10)
    systemProperty("junit.jupiter.execution.parallel.config.fixed.max-pool-size", 10)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions