attilapiros commented on a change in pull request #32287:
URL: https://github.com/apache/spark/pull/32287#discussion_r620335687



##########
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:
       I would avoid the random here but if you would like to keep this then 
let's log out this index to make the run more reproducible.




-- 
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]

Reply via email to