Skip to content

Commit

Permalink
Fix test in BlockFetcherIteratorSuite:
Browse files Browse the repository at this point in the history
We now signal failures via Futures that throw exception, not Futures that
contain messages with hasError set.
  • Loading branch information
JoshRosen committed Aug 6, 2014
1 parent 83673de commit 68620cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ object BlockFetcherIterator {
}
}
case Failure(exception) => {
logError("Could not get block(s) from " + cmId)
logError("Could not get block(s) from " + cmId, exception)
for ((blockId, size) <- req.blocks) {
results.put(new FetchResult(blockId, -1, null))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package org.apache.spark.storage

import java.io.IOException
import java.nio.ByteBuffer

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

val f = future {
val message = Message.createBufferMessage(0)
message.hasError = true
message
throw new IOException("Send failed or we received an error ACK")
}
when(connManager.sendMessageReliably(any(),
any())).thenReturn(f)
Expand Down

0 comments on commit 68620cb

Please sign in to comment.