Skip to content

Commit a762901

Browse files
committed
Fixing test failures
1 parent ffa00fe commit a762901

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,12 @@ class JsonProtocolSuite extends FunSuite {
133133

134134
def assertValidDataInJson(validateJson: JValue, expectedJson: JValue) {
135135
val Diff(c, a, d) = validateJson diff expectedJson
136-
assert(c === JNothing, "Json changed")
137-
assert(a === JNothing, "Json added")
138-
assert(d === JNothing, "Json deleted")
136+
val validatePretty = JsonMethods.pretty(validateJson)
137+
val expectedPretty = JsonMethods.pretty(expectedJson)
138+
val errorMessage = s"Expected:\n$expectedPretty\nFound:\n$validatePretty"
139+
assert(c === JNothing, s"$errorMessage\nChanged:\n${JsonMethods.pretty(c)}")
140+
assert(a === JNothing, s"$errorMessage\nAdded:\n${JsonMethods.pretty(a)}")
141+
assert(d === JNothing, s"$errorMessage\nDelected:\n${JsonMethods.pretty(d)}")
139142
}
140143
}
141144

@@ -165,7 +168,7 @@ object JsonConstants {
165168
"""
166169
|{"name":"name","cores":4,"memoryperslave":1234,
167170
|"user":"%s","sparkhome":"sparkHome",
168-
|"command":"Command(mainClass,List(arg1, arg2),Map())"}
171+
|"command":"Command(mainClass,List(arg1, arg2),Map(),List(),List(),None)"}
169172
""".format(System.getProperty("user.name", "<unknown>")).stripMargin
170173

171174
val executorRunnerJsonStr =

0 commit comments

Comments
 (0)