From 96c4f7a91d98bc3af2a155625ef8897f29661a88 Mon Sep 17 00:00:00 2001 From: Michael Bouschen Date: Sun, 14 Dec 2025 14:24:30 +0100 Subject: [PATCH 1/2] JDO-857: TCK: add a JDO flag to configure parallelism factor --- README.md | 1 + .../src/main/java/org/apache/jdo/exectck/Help.java | 4 ++++ .../main/java/org/apache/jdo/exectck/RunTCK.java | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 3afdd442..a5f55ba5 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ The *jdo-exectck* Maven plugin has the following options * -Djdo.tck.testrunner.details: Output mode for test run. Use one of: none, summary, flat, tree, verbose, testfeed. If `none`is selected, then only the summary and test failures are shown. * -Djdo.tck.testrunner.colors: Setting this parameter to *enable* displays colors in the junit result log file. * -Djdo.tck.parallel.execution: Setting this parameter to *false* will disable parallel exceution of tck test methods in parallel threads. +* -Djdo.tck.parallel.config.dynamic.factor: Computes the desired parallelism based on the number of available processors/cores multiplied by the factor configuration parameter. Defaults to 0.6. * -Djdo.tck.datastore.supportsQueryCancel: Setting this parameter to *true* indicates whether the datastore supports query canceling. * -Dproject.lib.ext.directory: Location of third party libraries such as JNDI. * -Ddatabase.runtck.sysproperties: Properties to use in accessing database. diff --git a/exectck/src/main/java/org/apache/jdo/exectck/Help.java b/exectck/src/main/java/org/apache/jdo/exectck/Help.java index db5c183e..372b1ec7 100644 --- a/exectck/src/main/java/org/apache/jdo/exectck/Help.java +++ b/exectck/src/main/java/org/apache/jdo/exectck/Help.java @@ -115,6 +115,10 @@ public void execute() throws MojoExecutionException, MojoFailureException { msg.append("* jdo.tck.parallel.execution:\n"); msg.append( " Setting this parameter to false will disable parallel exceution of tck test methods in parallel threads.\n"); + msg.append("* jdo.tck.parallel.config.dynamic.factor:\n"); + msg.append( + " Computes the desired parallelism based on the number of available processors/cores " + + "multiplied by the factor configuration parameter. Defaults to 0.6.\n"); msg.append("* jdo.tck.datastore.supportsQueryCancel:\n"); msg.append( " Setting this parameter to true indicates whether the datastore supports query canceling.\n"); diff --git a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java index f3d76e58..9e8c41bd 100644 --- a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java +++ b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java @@ -138,6 +138,16 @@ public class RunTCK extends AbstractTCKMojo { @Parameter(property = "jdo.tck.parallel.execution", defaultValue = "true", required = true) private boolean testParallelExecution; + /** + * Computes the desired parallelism based on the number of available processors/cores multiplied + * by factor configuration parameter. + */ + @Parameter( + property = "jdo.tck.parallel.config.dynamic.factor", + defaultValue = "0.6", + required = true) + private String testParallelDynamicFactor; + /** Whether the datastore supports query canceling. */ @Parameter(property = "jdo.tck.datastore.supportsQueryCancel", required = false) private String datastoreSupportsQueryCancel; @@ -555,6 +565,9 @@ private int executeTestClass( command.add("--details=" + testRunnerDetails); command.add("--config"); command.add("junit.jupiter.execution.parallel.enabled=" + testParallelExecution); + command.add("--config"); + command.add( + "junit.jupiter.execution.parallel.config.dynamic.factor=" + testParallelDynamicFactor); // add Test classes for (String testClass : classesList) { // skip empty entries From b6a7f0b758bc6e7758179e4dc484c6f44e371c36 Mon Sep 17 00:00:00 2001 From: Michael Bouschen Date: Sun, 28 Dec 2025 17:37:23 +0100 Subject: [PATCH 2/2] JDO-857: set junit option only if tck option is specified --- .../main/java/org/apache/jdo/exectck/RunTCK.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java index 9e8c41bd..b807f84a 100644 --- a/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java +++ b/exectck/src/main/java/org/apache/jdo/exectck/RunTCK.java @@ -142,10 +142,7 @@ public class RunTCK extends AbstractTCKMojo { * Computes the desired parallelism based on the number of available processors/cores multiplied * by factor configuration parameter. */ - @Parameter( - property = "jdo.tck.parallel.config.dynamic.factor", - defaultValue = "0.6", - required = true) + @Parameter(property = "jdo.tck.parallel.config.dynamic.factor") private String testParallelDynamicFactor; /** Whether the datastore supports query canceling. */ @@ -565,9 +562,11 @@ private int executeTestClass( command.add("--details=" + testRunnerDetails); command.add("--config"); command.add("junit.jupiter.execution.parallel.enabled=" + testParallelExecution); - command.add("--config"); - command.add( - "junit.jupiter.execution.parallel.config.dynamic.factor=" + testParallelDynamicFactor); + if (testParallelDynamicFactor != null && !testParallelDynamicFactor.trim().isEmpty()) { + command.add("--config"); + command.add( + "junit.jupiter.execution.parallel.config.dynamic.factor=" + testParallelDynamicFactor); + } // add Test classes for (String testClass : classesList) { // skip empty entries