Skip to content

Commit fbbf3f7

Browse files
dongjoon-hyunhuangxiaopingRD
authored andcommitted
[SPARK-53324][K8S][FOLLOWUP] Use invokePrivate to access numOutstandingPods
### What changes were proposed in this pull request? This is a follow-up of the following to apply the latest `master` branch change. - apache#51913 ### Why are the changes needed? The master branch compilation is broken currently. - https://github.com/apache/spark/actions/runs/18760939731 Recently, we changed `numOutstandingPods`'s visibility, but I missed that the old open PRs didn't have this change. - apache#52614 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#52714 from dongjoon-hyun/SPARK-53324. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 4b1bdf5 commit fbbf3f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

resource-managers/kubernetes/core/src/test/scala/org/apache/spark/scheduler/cluster/k8s/ExecutorPodsAllocatorSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class ExecutorPodsAllocatorSuite extends SparkFunSuite with BeforeAndAfter {
273273
// Request more than the max per rp for one rp
274274
podsAllocatorUnderTest.setTotalExpectedExecutors(Map(defaultProfile -> 2, rp -> 3))
275275
// 2 for default, and 2 for rp
276-
assert(podsAllocatorUnderTest.numOutstandingPods.get() == 4)
276+
assert(podsAllocatorUnderTest.invokePrivate(numOutstandingPods).get() == 4)
277277
verify(podsWithNamespace).resource(podWithAttachedContainerForId(1, defaultProfile.id))
278278
verify(podsWithNamespace).resource(podWithAttachedContainerForId(2, defaultProfile.id))
279279
verify(podsWithNamespace).resource(podWithAttachedContainerForId(3, rp.id))
@@ -285,7 +285,7 @@ class ExecutorPodsAllocatorSuite extends SparkFunSuite with BeforeAndAfter {
285285
snapshotsStore.updatePod(pendingExecutor(2, defaultProfile.id))
286286
snapshotsStore.updatePod(pendingExecutor(3, rp.id))
287287
snapshotsStore.notifySubscribers()
288-
assert(podsAllocatorUnderTest.numOutstandingPods.get() == 4)
288+
assert(podsAllocatorUnderTest.invokePrivate(numOutstandingPods).get() == 4)
289289
verify(podResource, times(4)).create()
290290
verify(labeledPods, never()).delete()
291291

@@ -294,14 +294,14 @@ class ExecutorPodsAllocatorSuite extends SparkFunSuite with BeforeAndAfter {
294294
waitForExecutorPodsClock.advance(executorIdleTimeout * 2)
295295
podsAllocatorUnderTest.setTotalExpectedExecutors(Map(defaultProfile -> 1, rp -> 3))
296296
snapshotsStore.notifySubscribers()
297-
assert(podsAllocatorUnderTest.numOutstandingPods.get() == 3)
297+
assert(podsAllocatorUnderTest.invokePrivate(numOutstandingPods).get() == 3)
298298
verify(labeledPods, times(1)).delete()
299299

300300
// Make one pod running from non-default rp so we have one more slot for pending pods.
301301
snapshotsStore.updatePod(runningExecutor(3, rp.id))
302302
snapshotsStore.updatePod(pendingExecutor(4, rp.id))
303303
snapshotsStore.notifySubscribers()
304-
assert(podsAllocatorUnderTest.numOutstandingPods.get() == 3)
304+
assert(podsAllocatorUnderTest.invokePrivate(numOutstandingPods).get() == 3)
305305
verify(podsWithNamespace).resource(podWithAttachedContainerForId(5, rp.id))
306306
verify(labeledPods, times(1)).delete()
307307
}

0 commit comments

Comments
 (0)