Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-31746][YARN][TESTS] Show the actual error message in LocalityPlacementStrategySuite #28566

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, yeah. Seems it's used in the branch-3.0. I will fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now. thanks for pointing out quickly.

val strategy = new LocalityPreferredContainerPlacementStrategy(new SparkConf(),
yarnConf, new MockResolver())

Expand Down