Skip to content

Commit c7bc490

Browse files
committed
Show the actual error message in LocalityPlacementStrategySuite
1 parent 097d509 commit c7bc490

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/LocalityPlacementStrategySuite.scala

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
package org.apache.spark.deploy.yarn
1919

20-
import scala.collection.JavaConverters._
20+
import java.io.{PrintWriter, StringWriter}
21+
2122
import scala.collection.mutable.{HashMap, HashSet, Set}
2223

2324
import org.apache.hadoop.yarn.api.records._
@@ -46,7 +47,11 @@ class LocalityPlacementStrategySuite extends SparkFunSuite {
4647
thread.start()
4748
thread.join()
4849

49-
assert(error === null)
50+
if (error != null) {
51+
val errors = new StringWriter()
52+
error.printStackTrace(new PrintWriter(errors))
53+
fail(s"StackOverflowError should not be thrown; however, got:\n\n$errors")
54+
}
5055
}
5156

5257
private def runTest(): Unit = {
@@ -57,7 +62,6 @@ class LocalityPlacementStrategySuite extends SparkFunSuite {
5762
// goal is to create enough requests for localized containers (so there should be many
5863
// tasks on several hosts that have no allocated containers).
5964

60-
val resource = Resource.newInstance(8 * 1024, 4)
6165
val strategy = new LocalityPreferredContainerPlacementStrategy(new SparkConf(),
6266
yarnConf, new MockResolver())
6367

0 commit comments

Comments
 (0)