Ngone51 commented on a change in pull request #32287:
URL: https://github.com/apache/spark/pull/32287#discussion_r620782919
##########
File path:
core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala
##########
@@ -48,15 +49,22 @@ class ShuffleBlockFetcherIteratorSuite extends
SparkFunSuite with PrivateMethodT
// in the presence of faults.
/** Creates a mock [[BlockTransferService]] that returns data from the given
map. */
- private def createMockTransfer(data: Map[BlockId, ManagedBuffer]):
BlockTransferService = {
+ private def createMockTransfer(
+ data: Map[BlockId, ManagedBuffer],
+ throwNettyOOM: Boolean = false): BlockTransferService = {
val transfer = mock(classOf[BlockTransferService])
+ var hasThrowOOM = false
when(transfer.fetchBlocks(any(), any(), any(), any(), any(),
any())).thenAnswer(
(invocation: InvocationOnMock) => {
val blocks = invocation.getArguments()(3).asInstanceOf[Array[String]]
val listener =
invocation.getArguments()(4).asInstanceOf[BlockFetchingListener]
+ val OOMBlockIndex = new
Random(System.currentTimeMillis()).nextInt(blocks.length)
Review comment:
The random intends to test both failure cases of "the last block of a
request" and "a middle block of a request". I'll make it determined.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]