Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-50776][K8S][TESTS] Fix test assertions on executor service acc…
…ount ### What changes were proposed in this pull request? `ExecutorKubernetesCredentialsFeatureStepSuite` tests that Spark sets the correct service account on executor pods for various configuration combinations. This patch corrects some invalid test assertions and refactors to reduce redundancy across the different test cases. ### Why are the changes needed? `ExecutorKubernetesCredentialsFeatureStepSuite` attempts to check that the Spark code sets the correct service account on the executor pod. However, the current assertions are actually no-ops that check if a variable is equal to itself, which is always true. The test would pass even if the product code had a bug. ### Does this PR introduce _any_ user-facing change? No, this is a change in tests only. ### How was this patch tested? 1. Intentionally introduce a bug in `ExecutorKubernetesCredentialsFeatureStep` by hard-coding a bogus service account (not included in this pull request). 1. `build/mvn -o -Pkubernetes -Pscala-2.12 -pl resource-managers/kubernetes/core -Dsuites='org.apache.spark.deploy.k8s.features.ExecutorKubernetesCredentialsFeatureStepSuite' test` 1. The test succeeds, even though there is a bug. 1. Apply this patch. 1. Rerun the test, and it fails, as it should. 1. Revert the bug, rerun the test, and it succeeds. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#49428 from cnauroth/SPARK-50776. Authored-by: Chris Nauroth <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information