Skip to content

Commit b671ce0

Browse files
zsxwingAndrew Or
authored andcommitted
[SPARK-4166][Core] Add a backward compatibility test for ExecutorLostFailure
Author: zsxwing <[email protected]> Closes #3085 from zsxwing/SPARK-4166-back-comp and squashes the following commits: 89329f4 [zsxwing] Add a backward compatibility test for ExecutorLostFailure
1 parent 9bdc841 commit b671ce0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ class JsonProtocolSuite extends FunSuite {
196196
assert(applicationStart === JsonProtocol.applicationStartFromJson(oldEvent))
197197
}
198198

199+
test("ExecutorLostFailure backward compatibility") {
200+
// ExecutorLostFailure in Spark 1.1.0 does not have an "Executor ID" property.
201+
val executorLostFailure = ExecutorLostFailure("100")
202+
val oldEvent = JsonProtocol.taskEndReasonToJson(executorLostFailure)
203+
.removeField({ _._1 == "Executor ID" })
204+
val expectedExecutorLostFailure = ExecutorLostFailure("Unknown")
205+
assert(expectedExecutorLostFailure === JsonProtocol.taskEndReasonFromJson(oldEvent))
206+
}
207+
199208
/** -------------------------- *
200209
| Helper test running methods |
201210
* --------------------------- */

0 commit comments

Comments
 (0)