Skip to content

Commit

Permalink
Add a backward compatibility test for FetchFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Nov 4, 2014
1 parent 2812815 commit 21cb2a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@ class JsonProtocolSuite extends FunSuite {
deserializedBmRemoved)
}

test("FetchFailed backwards compatibility") {
// FetchFailed in Spark 1.1.0 does not have an "Message" property.
val fetchFailed = FetchFailed(BlockManagerId("With or", "without you", 15), 17, 18, 19,
"ignored")
val oldEvent = JsonProtocol.taskEndReasonToJson(fetchFailed)
.removeField({ _._1 == "Message" })
val expectedFetchFailed = FetchFailed(BlockManagerId("With or", "without you", 15), 17, 18, 19,
"Unknown reason")
assert(expectedFetchFailed === JsonProtocol.taskEndReasonFromJson(oldEvent))
}

test("SparkListenerApplicationStart backwards compatibility") {
// SparkListenerApplicationStart in Spark 1.0.0 do not have an "appId" property.
val applicationStart = SparkListenerApplicationStart("test", None, 1L, "user")
Expand Down

0 comments on commit 21cb2a8

Please sign in to comment.