From 0d492fdb0e85cffe8e74a81d9258fe8fb0a68830 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Thu, 10 Sep 2026 17:29:48 +0200 Subject: [PATCH] CI: Try running some tests in parallel standard linux runner has 4 cores java.hints module: - hints tests have their workspace split by FQ test name and appear to be able to run concurrently on a per-class basis --- .github/workflows/main.yml | 10 +++------- java/java.hints/nbproject/project.properties | 12 ++---------- .../hints/jdk/ConvertSwitchToRuleSwitchTest.java | 16 ---------------- nbbuild/templates/common.xml | 3 ++- 4 files changed, 7 insertions(+), 34 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1cffa107aa4..359b3d9367ae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1465,7 +1465,7 @@ jobs: java-hints-test: - name: Java Hints ${{ matrix.config }} on Linux/JDK ${{ matrix.java }} + name: Java Hints on Linux/JDK ${{ matrix.java }} # equals env.test_java == 'true' if: ${{ contains(github.event.pull_request.labels.*.name, 'Java') || contains(github.event.pull_request.labels.*.name, 'ci:all-tests') || github.event_name != 'pull_request' }} needs: base-build @@ -1474,7 +1474,6 @@ jobs: strategy: matrix: java: [ '21', '27-ea' ] - config: [ 'batch1', 'batch2' ] exclude: - java: ${{ github.event_name == 'pull_request' && 'nothing' || '27-ea' }} fail-fast: false @@ -1501,18 +1500,15 @@ jobs: run: tar --zstd -xf build.tar.zst - name: java.hints (unreliable tests) - if: ${{ (matrix.config == 'batch2') && success() }} run: .github/retry.sh ant $OPTS -Dtest.config=unreliable -f java/java.hints test - - name: java.hints ${{ matrix.config }} - run: ant $OPTS -Dtest.config=${{ matrix.config }} -f java/java.hints test + - name: java.hints + run: ant $OPTS -Dtest.threads=4 -f java/java.hints test - name: java.hints.declarative - if: ${{ (matrix.config == 'batch2') && success() }} run: ant $OPTS -f java/java.hints.declarative test - name: spi.java.hints - if: ${{ (matrix.config == 'batch2') && success() }} run: ant $OPTS -f java/spi.java.hints test - name: Create Test Summary diff --git a/java/java.hints/nbproject/project.properties b/java/java.hints/nbproject/project.properties index 576fd1b40d31..d200260fc35e 100644 --- a/java/java.hints/nbproject/project.properties +++ b/java/java.hints/nbproject/project.properties @@ -61,17 +61,9 @@ test.runner=junit test-unit-sys-prop.hints-tools.jar.location=${tools.jar} -test.config.batch1.includes=\ +test.config.default.includes=\ **/*Test.class -test.config.batch1.excludes=\ - **/errors/*Test.class,\ - **/jdk/*Test.class,\ - ${test.config.unreliable.includes} - -test.config.batch2.includes=\ - **/errors/*Test.class,\ - **/jdk/*Test.class -test.config.batch2.excludes=\ +test.config.default.excludes=\ ${test.config.unreliable.includes} # frequent failures diff --git a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java index 3e763142cc7d..f338cbd0cb29 100644 --- a/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java +++ b/java/java.hints/test/unit/src/org/netbeans/modules/java/hints/jdk/ConvertSwitchToRuleSwitchTest.java @@ -18,10 +18,7 @@ */ package org.netbeans.modules.java.hints.jdk; -import com.sun.tools.javac.tree.JCTree; import javax.lang.model.SourceVersion; -import junit.framework.Test; -import junit.framework.TestSuite; import org.netbeans.junit.NbTestCase; import org.netbeans.modules.java.hints.test.api.HintTest; @@ -1046,17 +1043,4 @@ public void testSwitchExpressionGuardedPattern() throws Exception { + "}"); } - public static Test suite() { - TestSuite suite = new TestSuite(); - try { - Class.forName("com.sun.source.tree.CaseTree$CaseKind", false, JCTree.class.getClassLoader()); - suite.addTestSuite(ConvertSwitchToRuleSwitchTest.class); - } catch (ClassNotFoundException ex) { - //OK - suite.addTest(new ConvertSwitchToRuleSwitchTest("noop")); - } - return suite; - } - - public void noop() {} } diff --git a/nbbuild/templates/common.xml b/nbbuild/templates/common.xml index eef127194681..c6bf515a64f8 100644 --- a/nbbuild/templates/common.xml +++ b/nbbuild/templates/common.xml @@ -760,11 +760,12 @@ + - +