WweiL commented on code in PR #51948:
URL: https://github.com/apache/spark/pull/51948#discussion_r2267408999
##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ExecutorRunnableSuite.scala:
##########
@@ -103,4 +106,33 @@ class ExecutorRunnableSuite extends SparkFunSuite {
val metadataStorageVal: Any =
metaInfo.get(SHUFFLE_SERVER_RECOVERY_DISABLED.key)
assert(metadataStorageVal != null &&
metadataStorageVal.asInstanceOf[Boolean])
}
+
+ test("SPARK-53209: ActiveProcessorCount should default to 1 when executor
cores not configured") {
+ val sparkConf = new SparkConf()
+ val execRunnable = createExecutorRunnable(sparkConf)
+
+ val commands = execRunnable.prepareCommand()
+ commands should contain ("-XX:ActiveProcessorCount=1")
+ commands should contain inOrderElementsOf List("--cores", "1")
+ }
+
+ test("SPARK-53209: ActiveProcessorCount should match configured executor
cores") {
+ val sparkConf = new SparkConf()
+ .set(EXECUTOR_CORES, 4)
+ val execRunnable = createExecutorRunnable(sparkConf)
+
+ val commands = execRunnable.prepareCommand()
+ commands should contain ("-XX:ActiveProcessorCount=4")
+ commands should contain inOrderElementsOf List("--cores", "4")
+ }
+
+ test("SPARK-53209: ActiveProcessorCount should respect custom executor core
count") {
+ val sparkConf = new SparkConf()
+ .set(EXECUTOR_CORES, 7)
+ val execRunnable = createExecutorRunnable(sparkConf)
+
+ val commands = execRunnable.prepareCommand()
+ commands should contain ("-XX:ActiveProcessorCount=7")
+ commands should contain inOrderElementsOf List("--cores", "7")
+ }
Review Comment:
Above two tests seem to be identical (except the number of cores)? Is there
anything else special we are testing here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]