Skip to content

Commit e4f4ece

Browse files
fix failed test
1 parent 5d23958 commit e4f4ece

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/test/scala/org/apache/spark/deploy/rest/StandaloneRestSubmitSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import com.google.common.base.Charsets
2828
import org.scalatest.{BeforeAndAfterEach, FunSuite}
2929
import org.json4s.JsonAST._
3030
import org.json4s.jackson.JsonMethods._
31+
import com.fasterxml.jackson.core.JsonParseException
3132

3233
import org.apache.spark._
3334
import org.apache.spark.util.{AkkaUtils, Utils}
@@ -352,7 +353,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
352353
// server returns malformed response unwittingly
353354
// client should throw an appropriate exception to indicate server failure
354355
val conn1 = sendHttpRequest(submitRequestPath, "POST", json)
355-
intercept[SubmitRestProtocolException] { client.readResponse(conn1) }
356+
intercept[JsonParseException] { client.readResponse(conn1) }
356357
// server attempts to send invalid response, but fails internally on validation
357358
// client should receive an error response as server is able to recover
358359
val conn2 = sendHttpRequest(killRequestPath, "POST")
@@ -362,7 +363,7 @@ class StandaloneRestSubmitSuite extends FunSuite with BeforeAndAfterEach {
362363
// server explodes internally beyond recovery
363364
// client should throw an appropriate exception to indicate server failure
364365
val conn3 = sendHttpRequest(statusRequestPath, "GET")
365-
intercept[SubmitRestProtocolException] { client.readResponse(conn3) } // empty response
366+
intercept[JsonParseException] { client.readResponse(conn3) } // empty response
366367
assert(conn3.getResponseCode === HttpServletResponse.SC_INTERNAL_SERVER_ERROR)
367368
}
368369

0 commit comments

Comments
 (0)