[FLINK-40375] Fix kube-apiserver and mock-server tests silently skipped in CI - #1177
Merged
Merged
Conversation
Dennis-Mircea
approved these changes
Aug 12, 2026
Dennis-Mircea
left a comment
Contributor
There was a problem hiding this comment.
Thanks for opening this PR, that's a good catch! The new pom comments are a bit more verbose than they need to be, but other than that, it looks good.
Contributor
Author
|
Before: |
Contributor
Author
|
After |
Five test classes reported "Tests run: 0" while the build stayed green, leaving 10 test methods without coverage. Two independent problems compounded: - flink-kubernetes-operator-api declared commons-io 2.17.0 directly, which by nearest-definition overrode the 2.20.0 that commons-compress 1.28.0 (via io.fabric8:kube-api-test) is built against. The binary download succeeded and extraction then failed with an IllegalAccessError in GzipCompressorInputStream. This only reproduces on a cold ~/.kubeapitest cache, which is why it showed on CI runners only. - kubernetes-server-mock declares kubernetes-client as optional, so it is not inherited transitively. flink-kubernetes-standalone only has the fabric8 client shaded into flink-kubernetes, so the mock server extension failed with NoClassDefFoundError: HasMetadata. Both failures happen in beforeAll, and surefire 3.0.0-M4 discards those (fixed in 3.0.0-M5), so nothing was recorded in the surefire report. Bump surefire to 3.5.6 so such failures fail the build, bump commons-io to 2.22.0, and add the unshaded kubernetes-client plus an httpclient implementation at test scope to flink-kubernetes-standalone. This recovers 10 test methods across five classes: FlinkConfigurationYamlSupportTest (1), EventUtilsApiServerTest (2), FlinkOperatorTest (2), KubernetesStandaloneClusterDescriptorTest (3) and Fabric8FlinkStandaloneKubeClientTest (2).
spuru9
force-pushed
the
FLINK-40375-kubeapiserver-tests
branch
from
August 12, 2026 19:05
2ed1219 to
d841210
Compare
Contributor
Author
|
Have made comments precise as per the review from @Dennis-Mircea |
Dennis-Mircea
approved these changes
Aug 13, 2026
gyfora
approved these changes
Aug 13, 2026
csviri
approved these changes
Aug 13, 2026
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.

What is the purpose of the change
Five test classes report
Tests run: 0while the build passes, so 10 test methodscontribute no coverage. This fixes the underlying failures and makes such failures
fail the build instead of passing silently.
The cause is not a binary download failure — the download succeeds and extraction
then fails. Two independent problems compound:
1. Binary extraction crashes.
flink-kubernetes-operator-apideclarescommons-io:2.17.0directly, which by Maven's nearest-definition rule overrides the2.20.0thatcommons-compress:1.28.0(pulled in byio.fabric8:kube-api-test) isbuilt against:
This only reproduces on a cold
~/.kubeapitestcache, which is why it appears on CIrunners but not on developer machines with a warm cache.
2. The failure is swallowed. Both failures occur in
beforeAll, andmaven-surefire-plugin 3.0.0-M4 discards those — fixed in 3.0.0-M5
(SUREFIRE-1741, of which
SUREFIRE-1688 is a duplicate).
The surefire XML report contains no error record at all.
Bumping surefire then turned the build red on two further classes with the same
suppressed-
beforeAllpattern but a different cause:kubernetes-server-mockdeclares
kubernetes-clientas<optional>true</optional>so it is not inheritedtransitively, and
flink-kubernetes-standaloneonly has the fabric8 client shadedinto
flink-kubernetes. Its mock-server tests failed withNoClassDefFoundError: io/fabric8/kubernetes/api/model/HasMetadata. Supplying theunshaded client then surfaced a second layer, since
kubernetes-clientis managedwith every httpclient implementation excluded. Both were pre-existing — confirmed
reporting
Tests run: 0on surefire 3.0.0-M4.Brief change log
maven-surefire-pluginfrom 3.0.0-M4 to 3.5.6 sobeforeAllfailures fail the buildcommons-iofrom 2.17.0 to 2.22.0 (latest stable in the major), with a comment recording the constraintio.fabric8:kubernetes-clientand an httpclient implementation at test scope toflink-kubernetes-standaloneNOTICEfor the bundledcommons-ioversionmaven-failsafe-pluginneeds no change — it is already on 3.0.0-M5, which contains the fix.Verifying this change
Verified locally with a cold
~/.kubeapitestcache and all quality checks enabled.Before (at the previous base commit), the build was green while running 2718 tests,
with these classes silently at
Tests run: 0:FlinkConfigurationYamlSupportTestEventUtilsApiServerTestFlinkOperatorTestKubernetesStandaloneClusterDescriptorTestFabric8FlinkStandaloneKubeClientTestmvn clean installnow passes and runs 10 more tests than before. Reverting only thecommons-iobump correctly producesBUILD FAILURE(exit 1) rather thanTests run: 0+BUILD SUCCESS, confirming the failure is no longer silent.Note:
ScalingExecutorTestalso reportsTests run: 0because its@Nestedclass iscredited with the full count. That is a reporting artifact present identically on both
surefire versions, not a skipped test, and is unaffected by this change.
Does this pull request potentially affect one of the following parts:
commons-io2.17.0 -> 2.22.0 (bundled,NOTICEupdated); two test-scope dependencies added toflink-kubernetes-standalone;maven-surefire-plugin3.0.0-M4 -> 3.5.6@Public(Evolving): noDocumentation