Skip to content

Commit 68620cb

Browse files
committed
Fix test in BlockFetcherIteratorSuite:
We now signal failures via Futures that throw exception, not Futures that contain messages with hasError set.
1 parent 83673de commit 68620cb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ object BlockFetcherIterator {
137137
}
138138
}
139139
case Failure(exception) => {
140-
logError("Could not get block(s) from " + cmId)
140+
logError("Could not get block(s) from " + cmId, exception)
141141
for ((blockId, size) <- req.blocks) {
142142
results.put(new FetchResult(blockId, -1, null))
143143
}

core/src/test/scala/org/apache/spark/storage/BlockFetcherIteratorSuite.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.storage
1919

20+
import java.io.IOException
2021
import java.nio.ByteBuffer
2122

2223
import scala.collection.mutable.ArrayBuffer
@@ -146,9 +147,7 @@ class BlockFetcherIteratorSuite extends FunSuite with Matchers {
146147
when(blockManager.connectionManager).thenReturn(connManager)
147148

148149
val f = future {
149-
val message = Message.createBufferMessage(0)
150-
message.hasError = true
151-
message
150+
throw new IOException("Send failed or we received an error ACK")
152151
}
153152
when(connManager.sendMessageReliably(any(),
154153
any())).thenReturn(f)

0 commit comments

Comments
 (0)