This is an automated email from the ASF dual-hosted git repository.

xiangfu0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 078c814f192 Rebalance PR CI workers without changing test fixtures 
(#20085)
078c814f192 is described below

commit 078c814f192e13e82f638253cd50802ac1652b70
Author: Xiang Fu <[email protected]>
AuthorDate: Mon Nov 23 10:32:34 2026 -0800

    Rebalance PR CI workers without changing test fixtures (#20085)
---
 .github/workflows/pinot_unit_tests.yml             | 73 ++++++++++++++++++++--
 .../scripts/pr-tests/.pinot_tests_build.sh         | 18 +++++-
 .../scripts/pr-tests/.pinot_tests_unit.sh          | 29 ++++++---
 pinot-integration-tests/pom.xml                    |  7 +--
 4 files changed, 108 insertions(+), 19 deletions(-)

diff --git a/.github/workflows/pinot_unit_tests.yml 
b/.github/workflows/pinot_unit_tests.yml
index e6b940db8c2..68191b99ca7 100644
--- a/.github/workflows/pinot_unit_tests.yml
+++ b/.github/workflows/pinot_unit_tests.yml
@@ -83,17 +83,28 @@ jobs:
         timeout-minutes: 120
         run: |
           .github/workflows/scripts/.pinot_linter.sh
-  unit-test:
+  unit-test-shards:
     if: github.repository == 'apache/pinot'
     runs-on: ubuntu-latest
     strategy:
       # Changed to false in order to improve coverage using unsafe buffers
       fail-fast: false
       matrix:
-        testset: [ 1, 2 ]
+        testset: [ 1, 2, 3 ]
         java: [ 25 ]
         distribution: [ "temurin" ]
-    name: Pinot Unit Test Set ${{ matrix.testset }} 
(${{matrix.distribution}}-${{matrix.java}})
+        include:
+          - testset: 1
+            legacy_testset: 1
+          - testset: 2
+            legacy_testset: 2
+          - testset: 3
+            legacy_testset: 1
+    name: Pinot Unit Shard ${{ matrix.testset }} 
(${{matrix.distribution}}-${{matrix.java}})
+    outputs:
+      testset_1: ${{ steps.completed.outputs.testset_1 }}
+      testset_2: ${{ steps.completed.outputs.testset_2 }}
+      testset_3: ${{ steps.completed.outputs.testset_3 }}
     steps:
       - uses: actions/[email protected]
       - name: Set up JDK ${{ matrix.java }}-${{ matrix.distribution }}
@@ -138,6 +149,7 @@ jobs:
         run: |
           .github/workflows/scripts/pr-tests/.pinot_tests_build.sh
       - name: Unit Test
+        id: run-tests
         env:
           RUN_INTEGRATION_TESTS: false
           RUN_TEST_SET: ${{ matrix.testset }}
@@ -163,13 +175,20 @@ jobs:
         timeout-minutes: 120
         run: |
           .github/workflows/scripts/pr-tests/.pinot_tests_unit.sh
+      - name: Record shard completion
+        id: completed
+        if: ${{ success() && steps.run-tests.outcome == 'success' }}
+        env:
+          TEST_SET: ${{ matrix.testset }}
+        run: |
+          echo 
"testset_${TEST_SET}=${GITHUB_SHA}:${GITHUB_RUN_ID}:${GITHUB_RUN_ATTEMPT}:${TEST_SET}"
 >> "$GITHUB_OUTPUT"
       - name: Upload coverage to Codecov
         uses: codecov/codecov-action@v7
         continue-on-error: true
         timeout-minutes: 5
         with:
-          flags: unittests,unittests${{ matrix.testset 
}},${{matrix.distribution}},java-${{matrix.java}}
-          name: codecov-unit-tests
+          flags: unittests,unittests${{ matrix.legacy_testset 
}},${{matrix.distribution}},java-${{matrix.java}}
+          name: codecov-unit-tests-${{ matrix.testset }}
           token: ${{ secrets.CODECOV_TOKEN }}
           fail_ci_if_error: false
           verbose: true
@@ -188,3 +207,47 @@ jobs:
             **/target/surefire-reports/
             **/target/site/surefire-report.html
           retention-days: 30
+
+  unit-test:
+    # Retain both legacy required check names; each requires every actual unit 
worker.
+    if: ${{ always() && github.repository == 'apache/pinot' }}
+    needs: unit-test-shards
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        testset: [ 1, 2 ]
+        java: [ 25 ]
+        distribution: [ "temurin" ]
+    name: Pinot Unit Test Set ${{ matrix.testset }} 
(${{matrix.distribution}}-${{matrix.java}})
+    steps:
+      - name: Require all unit workers
+        env:
+          SHARD_RESULT: ${{ needs.unit-test-shards.result }}
+          SET_1: ${{ needs.unit-test-shards.outputs.testset_1 }}
+          SET_2: ${{ needs.unit-test-shards.outputs.testset_2 }}
+          SET_3: ${{ needs.unit-test-shards.outputs.testset_3 }}
+        run: |
+          if [ "$SHARD_RESULT" != success ]; then
+            echo "Required unit worker result: $SHARD_RESULT"
+            exit 1
+          fi
+          for shard in 1 2 3; do
+            output="SET_${shard}"
+            IFS=: read -r sha run attempt recorded_shard extra <<< "${!output}"
+            if [ "$sha" != "$GITHUB_SHA" ] || [ "$run" != "$GITHUB_RUN_ID" ] \
+                || [ "$recorded_shard" != "$shard" ] || [ -n "$extra" ] \
+                || [ "${!output}" != 
"${sha}:${run}:${attempt}:${recorded_shard}" ]; then
+              echo "Unit worker $shard did not record successful completion 
for this run"
+              exit 1
+            fi
+            case "$attempt" in
+              ''|0*|*[!0-9]*) echo "Invalid completion attempt for unit worker 
$shard"; exit 1 ;;
+            esac
+            # A failed-jobs rerun retains successful workers from earlier 
attempts of this same run.
+            if [ "${#attempt}" -gt "${#GITHUB_RUN_ATTEMPT}" ] \
+                || [ "$attempt" -gt "$GITHUB_RUN_ATTEMPT" ]; then
+              echo "Invalid completion attempt for unit worker $shard"
+              exit 1
+            fi
+          done
diff --git a/.github/workflows/scripts/pr-tests/.pinot_tests_build.sh 
b/.github/workflows/scripts/pr-tests/.pinot_tests_build.sh
index 4bdee334cf3..ac6c9454b25 100755
--- a/.github/workflows/scripts/pr-tests/.pinot_tests_build.sh
+++ b/.github/workflows/scripts/pr-tests/.pinot_tests_build.sh
@@ -18,6 +18,13 @@
 # under the License.
 #
 
+if [ "${RUN_INTEGRATION_TESTS:-}" == false ]; then
+  case "${RUN_TEST_SET:-}" in
+    1|2|3) ;;
+    *) echo "Unsupported RUN_TEST_SET value: ${RUN_TEST_SET:-unset}" >&2; exit 
1 ;;
+  esac
+fi
+
 # Java version
 java -version
 
@@ -36,8 +43,8 @@ if [ "$RUN_INTEGRATION_TESTS" != false ]; then
     -pl 'pinot-bom,pinot-integration-tests' || exit 1
 else
   # Unit Tests
-  #   - TEST_SET#1 runs install and test together so the module list must 
ensure no additional modules were tested
-  #     due to the -am flag (include dependency modules)
+  # Every worker installs its required dependencies with tests skipped. The 
subsequent test
+  # command selects only its assigned modules without -am, so dependency tests 
are not repeated.
   if [ "$RUN_TEST_SET" == "1" ]; then
     mvn clean install \
       -DskipTests -Dcheckstyle.skip -Dspotless.skip -Denforcer.skip 
-Dlicense.skip -Dmaven.plugin.appassembler.skip=true \
@@ -61,4 +68,11 @@ else
       -pl '!pinot-perf' \
       -pl '!pinot-distribution' || exit 1
   fi
+  if [ "$RUN_TEST_SET" == "3" ]; then
+    mvn clean install \
+      -DskipTests -Dcheckstyle.skip -Dspotless.skip -Denforcer.skip 
-Dlicense.skip -Dmaven.plugin.appassembler.skip=true \
+      -am -B -T 16 -ntp \
+      -P github-actions \
+      -pl 'pinot-bom,pinot-core' || exit 1
+  fi
 fi
diff --git a/.github/workflows/scripts/pr-tests/.pinot_tests_unit.sh 
b/.github/workflows/scripts/pr-tests/.pinot_tests_unit.sh
index 4ba09637f94..56378fc45b8 100755
--- a/.github/workflows/scripts/pr-tests/.pinot_tests_unit.sh
+++ b/.github/workflows/scripts/pr-tests/.pinot_tests_unit.sh
@@ -18,6 +18,11 @@
 # under the License.
 #
 
+case "${RUN_TEST_SET:-}" in
+  1|2|3) ;;
+  *) echo "Unsupported RUN_TEST_SET value: ${RUN_TEST_SET:-unset}" >&2; exit 1 
;;
+esac
+
 # Java version
 java -version
 
@@ -26,8 +31,14 @@ ifconfig
 netstat -i
 
 # Unit Tests
-#   - Both test sets run plain `mvn test` (no install, no -am): the modules 
were already built
-#     and installed by .pinot_tests_build.sh, so only the modules listed here 
are tested.
+#   - All three workers run `mvn test` (no install, no -am), so only the 
listed modules are tested.
+#     .pinot_tests_build.sh has already built and installed their required 
reactor dependencies.
+#   - The preceding clean install built the same sources with the same 
JDK/compiler settings.
+#     Use Maven's source/class timestamp check on this second invocation: the 
default incremental
+#     mode otherwise recompiles whole modules when reactor class directories 
become installed jars
+#     on the classpath. Missing classes or newer sources still compile, 
including modules omitted
+#     from the build step. Keep the test lifecycle so named Surefire suites, 
ScalaTest, resources,
+#     and JaCoCo still run. Do not use this setting for ordinary builds after 
source/API changes.
 #
 # Parallelism / memory:
 #   - UNIT_TEST_FORK_COUNT (default 3) sets surefire forkCount so test 
*classes* run in
@@ -64,21 +75,19 @@ else
   COVERAGE_PROFILE=""
 fi
 if [ "$RUN_TEST_SET" == "1" ]; then
-  # pinot-segment-local's tests run in set #2 to balance pinot-core's longer 
test time in this
-  # shard against set #2's longer build. It remains built in set #1 as a 
pinot-core dependency.
+  # Core tests run in worker #3. Its artifacts are still needed here by the 
query modules.
   # No -am on this command, so only the listed modules test.
-  mvn test ${FORK_OPTS} \
+  mvn test ${FORK_OPTS} -Dmaven.compiler.useIncrementalCompilation=false \
       -pl 'pinot-spi' \
       -pl 'pinot-segment-spi' \
       -pl 'pinot-common' \
       -pl ':pinot-yammer' \
-      -pl 'pinot-core' \
       -pl 'pinot-query-planner' \
       -pl 'pinot-query-runtime' \
       -P github-actions,no-integration-tests${COVERAGE_PROFILE} || exit 1
 fi
 if [ "$RUN_TEST_SET" == "2" ]; then
-  mvn test ${FORK_OPTS} \
+  mvn test ${FORK_OPTS} -Dmaven.compiler.useIncrementalCompilation=false \
     -pl '!pinot-spi' \
     -pl '!pinot-segment-spi' \
     -pl '!pinot-common' \
@@ -89,6 +98,12 @@ if [ "$RUN_TEST_SET" == "2" ]; then
     -P github-actions,no-integration-tests${COVERAGE_PROFILE} || exit 1
 fi
 
+if [ "$RUN_TEST_SET" == "3" ]; then
+  mvn test ${FORK_OPTS} -Dmaven.compiler.useIncrementalCompilation=false \
+    -pl 'pinot-core' \
+    -P github-actions,no-integration-tests${COVERAGE_PROFILE} || exit 1
+fi
+
 # Aggregate coverage across all per-fork exec files (jacoco-*.exec) written 
under forkCount>1,
 # while still matching the single-fork jacoco.exec produced by non-parallel 
runs. Skipped when
 # coverage is disabled.
diff --git a/pinot-integration-tests/pom.xml b/pinot-integration-tests/pom.xml
index 1eb386e7912..3bb71d51807 100644
--- a/pinot-integration-tests/pom.xml
+++ b/pinot-integration-tests/pom.xml
@@ -223,6 +223,8 @@
                 
<include>org/apache/pinot/integration/tests/N*Test.java</include>
                 
<include>org/apache/pinot/integration/tests/GrpcBrokerClusterIntegrationTest.java</include>
                 
<include>org/apache/pinot/integration/tests/legacy/*Test.java</include>
+                <!-- This class starts its own cluster and is excluded from 
LogicalTableSuite. -->
+                
<include>org/apache/pinot/integration/tests/logicaltable/KafkaPartitionSubsetChaosIntegrationTest.java</include>
               </includes>
               <excludes>
                 
<exclude>org/apache/pinot/integration/tests/IngestionConfigHybridIntegrationTest.java</exclude>
@@ -291,11 +293,6 @@
                 
<include>org/apache/pinot/integration/tests/P*Test.java</include>
                 
<include>org/apache/pinot/integration/tests/Q*Test.java</include>
                 
<include>org/apache/pinot/integration/tests/R*Test.java</include>
-                <!--
-                  In the logicaltable package but not a 
BaseLogicalTableIntegrationTest subclass: it runs its own
-                  cluster, so LogicalTableSuite below excludes it and it runs 
here instead.
-                -->
-                
<include>org/apache/pinot/integration/tests/logicaltable/KafkaPartitionSubsetChaosIntegrationTest.java</include>
               </includes>
               <excludes>
                 
<exclude>org/apache/pinot/integration/tests/OfflineClusterIntegrationTest.java</exclude>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to