Skip to content

Commit

Permalink
Show the actual error message in LocalityPlacementStrategySuite
Browse files Browse the repository at this point in the history
  • Loading branch information
HyukjinKwon committed May 18, 2020
1 parent 097d509 commit c7bc490
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

package org.apache.spark.deploy.yarn

import scala.collection.JavaConverters._
import java.io.{PrintWriter, StringWriter}

import scala.collection.mutable.{HashMap, HashSet, Set}

import org.apache.hadoop.yarn.api.records._
Expand Down Expand Up @@ -46,7 +47,11 @@ class LocalityPlacementStrategySuite extends SparkFunSuite {
thread.start()
thread.join()

assert(error === null)
if (error != null) {
val errors = new StringWriter()
error.printStackTrace(new PrintWriter(errors))
fail(s"StackOverflowError should not be thrown; however, got:\n\n$errors")
}
}

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

val resource = Resource.newInstance(8 * 1024, 4)
val strategy = new LocalityPreferredContainerPlacementStrategy(new SparkConf(),
yarnConf, new MockResolver())

Expand Down

0 comments on commit c7bc490

Please sign in to comment.