Fix unitTest task not running the test source set - #2074
Merged
reta merged 5 commits intoAug 1, 2026
Conversation
loggk
requested review from
Bukhtawar,
VachaShah,
Xtansia,
madhusudhankonda,
reta,
saratvemulapalli and
szczepanczykd
as code owners
July 31, 2026 22:14
loggk
marked this pull request as draft
July 31, 2026 22:29
Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
loggk
force-pushed
the
fix/unit-test-source-set-wiring
branch
from
July 31, 2026 22:34
ef732d4 to
d028e53
Compare
reta
reviewed
Jul 31, 2026
Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
reta
reviewed
Jul 31, 2026
Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
loggk
marked this pull request as ready for review
August 1, 2026 00:13
reta
approved these changes
Aug 1, 2026
|
The backport to |
Collaborator
@loggk would you mind please to backport to |
reta
pushed a commit
that referenced
this pull request
Aug 4, 2026
* Fix unitTest task not running the test source set * Add src/test/java to the java21 source set * Also add the test source set output to unitTest testClassesDirs * Drop srcDir in favor of testClassesDirs to avoid duplicate classes * Fix timing-flaky BulkIngester flush tests --------- (cherry picked from commit 83652e0) Signed-off-by: Logan Kennedy <kennedylogan22@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
./gradlew unitTestruns 1 test class instead of 170. The tests undersrc/test/javaare never executed locally or in CI. Nothing in CI runs the plaintesttask either (test-unit.ymlrunsunitTest,build.ymlrunsbuild -x test), so those ~200 test files are executed by no workflow at all.unitTestresolves its test classes from thejava21source set, which declaressrc/test/java11andsrc/test/java21but notsrc/test/java. So the main test source set is compiled but never run.This is original wiring rather than a regression:
unitTesthas never hadtestClassesDirsset, having been a baretask<Test>with only a filter since 3b34f60 (Aug 2021), so it ran zero tests. #968 later moved the JDK source set wiring fromtasks.testontounitTest/integrationTest, which incidentally gave it thejava11/java21classes. That is why it runs exactly one class today rather than none.Changes
Add the
testsource set's output tounitTest'stestClassesDirs, so the task resolves the tests insrc/test/javaalongside the JDK-specific source sets.Also fix two timing-flaky tests that re-enabling the suite surfaced.
BulkIngesterTest.periodicFlushTestandfailingListenerslept 100 ms between operations against a 50 ms flush interval and asserted exactly one request per operation. Under load two operations share a flush window and get coalesced. They now wait onrequestCount()reaching the expected value rather than on wall-clock time, which is both deterministic and faster.Verified with
./gradlew :java-client:unitTest: this takes the run from 1 test class to 170 (426 tests, 0 failures on JDK 21 and JDK 25). An unconditionally failing test added undersrc/test/java, which still reports BUILD SUCCESSFUL onmain, correctly fails the build with this change.RequestOptionsTestfromsrc/test/java11still runs, nointegTestclasses leak intounitTest, andspotlessJavaCheckpasses.Notes
One thing turned up while diagnosing this that is not addressed here, recorded in #2075.
Java 8. This change lives inside the
runtimeJavaVersion >= 21branch, so the JDK 8 path is untouched:unitTeststill has no classpath there and continues to compile and run nothing, which is whytest-java8stays green. Wiring that job up reveals thatjava-clientno longer compiles under Java 8 at all, sincetools.jackson.coreships Java 17 class files (class file has wrong version 61.0, should be 52.0), failing in:java-client:compileJavabefore tests are even considered. That looks like it dates to #1810. Happy to open a separate issue if that is useful.Issues Resolved
Related to #2075
Check List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.