Skip to content

Commit

Permalink
revise
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjoon-hyun committed Aug 26, 2024
1 parent 89bae7a commit a80548d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
assert((podsAllocatorUnderTest invokePrivate getReusablePVCs("appId", Seq("pvc-1"))).size == 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") {
Expand Down

0 comments on commit a80548d

Please sign in to comment.