ukby1234 commented on code in PR #42155:
URL: https://github.com/apache/spark/pull/42155#discussion_r1304945087
##########
core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionUnitSuite.scala:
##########
@@ -350,4 +350,39 @@ class BlockManagerDecommissionUnitSuite extends
SparkFunSuite with Matchers {
bmDecomManager.stop()
}
}
+
+ test("test cached rdd migration no available hosts") {
+ val blockTransferService = mock(classOf[BlockTransferService])
+ val bm = mock(classOf[BlockManager])
+
+ val storedBlockId1 = RDDBlockId(0, 0)
+ val storedBlock1 =
+ new ReplicateBlock(storedBlockId1, Seq(BlockManagerId("replicaHolder",
"host1", bmPort)), 1)
+
+ val migratableShuffleBlockResolver = mock(classOf[MigratableResolver])
+ registerShuffleBlocks(migratableShuffleBlockResolver, Set())
+ when(bm.getPeers(mc.any()))
+ .thenReturn(Seq(FallbackStorage.FALLBACK_BLOCK_MANAGER_ID))
+
+ when(bm.blockTransferService).thenReturn(blockTransferService)
+ when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver)
+ when(bm.getMigratableRDDBlocks())
+ .thenReturn(Seq(storedBlock1))
+
+ val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm)
+
+ try {
+ bmDecomManager.start()
+ eventually(timeout(100.second), interval(10.milliseconds)) {
+ assert(bmDecomManager.shufflesToMigrate.isEmpty === true)
+ assert(bmDecomManager.numMigratedShuffles.get() === 0)
Review Comment:
removed
##########
core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionUnitSuite.scala:
##########
@@ -350,4 +350,39 @@ class BlockManagerDecommissionUnitSuite extends
SparkFunSuite with Matchers {
bmDecomManager.stop()
}
}
+
+ test("test cached rdd migration no available hosts") {
+ val blockTransferService = mock(classOf[BlockTransferService])
+ val bm = mock(classOf[BlockManager])
+
+ val storedBlockId1 = RDDBlockId(0, 0)
+ val storedBlock1 =
+ new ReplicateBlock(storedBlockId1, Seq(BlockManagerId("replicaHolder",
"host1", bmPort)), 1)
+
+ val migratableShuffleBlockResolver = mock(classOf[MigratableResolver])
+ registerShuffleBlocks(migratableShuffleBlockResolver, Set())
+ when(bm.getPeers(mc.any()))
+ .thenReturn(Seq(FallbackStorage.FALLBACK_BLOCK_MANAGER_ID))
+
+ when(bm.blockTransferService).thenReturn(blockTransferService)
+ when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver)
+ when(bm.getMigratableRDDBlocks())
+ .thenReturn(Seq(storedBlock1))
+
+ val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm)
+
+ try {
+ bmDecomManager.start()
+ eventually(timeout(100.second), interval(10.milliseconds)) {
+ assert(bmDecomManager.shufflesToMigrate.isEmpty === true)
+ assert(bmDecomManager.numMigratedShuffles.get() === 0)
+ verify(bm, never()).replicateBlock(
+ mc.eq(storedBlockId1), mc.any(), mc.any(), mc.eq(Some(3)))
+ // BlockManagerDecommissioner stopped
+ assert(bmDecomManager.rddBlocksLeft)
Review Comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]