XN137 opened a new issue, #3239: URL: https://github.com/apache/maven-surefire/issues/3239
### New feature, improvement proposal Hello, i would like to propose adding a plugin property that allows users to force a specific checksum for looking up the statistics file here: https://github.com/apache/maven-surefire/blob/68aefe85847109504900adb77ee9c4624696072f/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java#L1827-L1829 my use case is the following: a single module that has hundreds of test classes, some of which take orders of magnitude longer than others. when we want to use `forkCount` higher than 0 to parallelize those tests we run into the problem that very long tests would be grouped into the same bucket, thus leading to a long overall test duration, not taking full advantage of the parallelism. grouping of tests should be based on their expected runtime, to create balanced buckets. for this we already have `runOrder=balanced`: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#runOrder the problem here is though that the checksum for the statistics file depends on many input variables like plugin version, system properties, env variables etc. for our CI system for example we pass the current build number as a system property into the surefire test execution as tests have to use specific build images via testcontainers. as a result, we are unable to use the statistics file for `runOrder=balanced` as we get a new checksum for each invocation. if we could override the checksum to a fixed value with the new property we could make sure to generate balanced buckets by using the statistic files from the last successful build. in our case the duration of a test class hardly ever depends on configuration and just about what the test class is doing. the currently baked in assumption seems to be that any change to the surefire configuration (i.e. system property) will invalidate all previous test runtime results, but i would argue that for most test classes this is not true. if such an "escape hatch" property would be accepted, i could work on providing a PR. thank you! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
