This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 5706942bc6ac [SPARK-49381][K8S][TESTS] Fix `SPARK-41388` test case to
assert the result
5706942bc6ac is described below
commit 5706942bc6ac7a84fb0b6630f13a4592f1c690f0
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Sun Aug 25 19:07:46 2024 -0700
[SPARK-49381][K8S][TESTS] Fix `SPARK-41388` test case to assert the result
### What changes were proposed in this pull request?
This PR aims to fix a test case of SPARK-41388 by adding a missed assert.
### Why are the changes needed?
To check the result correctly.
### Does this PR introduce _any_ user-facing change?
No, this is a test case change.
### How was this patch tested?
Pass the CIs with newly added assertion.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #47865 from dongjoon-hyun/SPARK-49381.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git
a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala
b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala
index adad63748abc..74a56729e86d 100644
---
a/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala
+++
b/resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala
@@ -845,15 +845,17 @@ class ExecutorPodsAllocatorSuite extends SparkFunSuite
with BeforeAndAfter {
val getReusablePVCs =
PrivateMethod[mutable.Buffer[PersistentVolumeClaim]](Symbol("getReusablePVCs"))
- val pvc1 = persistentVolumeClaim("pvc-0", "gp2", "200Gi")
- val pvc2 = persistentVolumeClaim("pvc-1", "gp2", "200Gi")
+ val pvc1 = persistentVolumeClaim("pvc-1", "gp2", "200Gi")
+ val pvc2 = persistentVolumeClaim("pvc-2", "gp2", "200Gi")
val now = Instant.now()
pvc1.getMetadata.setCreationTimestamp(now.minus(2 * podAllocationDelay,
MILLIS).toString)
pvc2.getMetadata.setCreationTimestamp(now.toString)
when(persistentVolumeClaimList.getItems).thenReturn(Seq(pvc1, pvc2).asJava)
- podsAllocatorUnderTest invokePrivate getReusablePVCs("appId", Seq("pvc-1"))
+ val reusablePVCs = podsAllocatorUnderTest invokePrivate
getReusablePVCs("appId", Seq.empty)
+ assert(reusablePVCs.size == 1)
+ assert(reusablePVCs.head.getMetadata.getName == "pvc-1")
}
test("SPARK-41410: Support waitToReusePersistentVolumeClaims") {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]