-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25004][CORE] Add spark.executor.pyspark.memory limit. #21977
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
Changes from 1 commit
a5004ba
306538b
9535a6b
5288f5b
fbac4a5
f11b3bb
ac7de4a
a38eac3
fcee94c
bb8fecb
0b275cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
This is needed to debug the tests.
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,7 +133,8 @@ abstract class BaseYarnClusterSuite | |
| extraClassPath: Seq[String] = Nil, | ||
| extraJars: Seq[String] = Nil, | ||
| extraConf: Map[String, String] = Map(), | ||
| extraEnv: Map[String, String] = Map()): SparkAppHandle.State = { | ||
| extraEnv: Map[String, String] = Map(), | ||
| outFile: Option[File] = None): SparkAppHandle.State = { | ||
| val deployMode = if (clientMode) "client" else "cluster" | ||
| val propsFile = createConfFile(extraClassPath = extraClassPath, extraConf = extraConf) | ||
| val env = Map("YARN_CONF_DIR" -> hadoopConfDir.getAbsolutePath()) ++ extraEnv | ||
|
|
@@ -161,6 +162,11 @@ abstract class BaseYarnClusterSuite | |
| } | ||
| extraJars.foreach(launcher.addJar) | ||
|
|
||
| if (outFile.isDefined) { | ||
| launcher.redirectOutput(outFile.get) | ||
| launcher.redirectError() | ||
| } | ||
|
|
||
| val handle = launcher.startApplication() | ||
| try { | ||
| eventually(timeout(2 minutes), interval(1 second)) { | ||
|
|
@@ -179,17 +185,22 @@ abstract class BaseYarnClusterSuite | |
| * the tests enforce that something is written to a file after everything is ok to indicate | ||
| * that the job succeeded. | ||
| */ | ||
| protected def checkResult(finalState: SparkAppHandle.State, result: File): Unit = { | ||
| checkResult(finalState, result, "success") | ||
| } | ||
|
|
||
| protected def checkResult( | ||
| finalState: SparkAppHandle.State, | ||
| result: File, | ||
| expected: String): Unit = { | ||
| finalState should be (SparkAppHandle.State.FINISHED) | ||
| expected: String = "success", | ||
| outFile: Option[File] = None): Unit = { | ||
| // the context message is passed to assert as Any instead of a function. to lazily load the | ||
| // output from the file, this passes an anonymous object that loads it in toString when building | ||
| // an error message | ||
| val output = new Object() { | ||
| override def toString: String = outFile | ||
| .map(Files.toString(_, StandardCharsets.UTF_8)) | ||
| .getOrElse("(stdout/stderr was not captured)") | ||
| } | ||
| assert(finalState === SparkAppHandle.State.FINISHED, output) | ||
| val resultString = Files.toString(result, StandardCharsets.UTF_8) | ||
| resultString should be (expected) | ||
| assert(resultString === expected, output) | ||
|
||
| } | ||
|
|
||
| protected def mainClassName(klass: Class[_]): String = { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outFile.foreach?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
foreachon an option is unclear (looks like a loop) and should be avoided unless it really simplifies the logic, which it doesn't do here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do a foreach then the
.getgoes away and the code could be a little cleaner, but it's pretty minor.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I said, I think
foreachis a bad practice with options, so I'd rather not change to use it. I'd be happy to change this to a pattern match if you think it is really desirable to get rid of the.get.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the pattern match would be better than the get.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, either way is fine.