squito commented on a change in pull request #23767: [SPARK-26329][CORE] Faster
polling of executor memory metrics.
URL: https://github.com/apache/spark/pull/23767#discussion_r304122257
##########
File path: core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala
##########
@@ -342,6 +320,87 @@ class ExecutorSuite extends SparkFunSuite
}
}
+ test("Send task executor metrics in DirectTaskResult") {
+ // Run a successful, trivial result task
+ // We need to ensure, however, that executor metrics are polled after the
task is started
+ // so this requires some coordination using ExecutorSuiteHelper.
+ val conf = new SparkConf().setMaster("local").setAppName("executor suite
test")
+ sc = new SparkContext(conf)
+ val serializer = SparkEnv.get.closureSerializer.newInstance()
+ ExecutorSuiteHelper.latches = new ExecutorSuiteHelper
+ val resultFunc =
+ (context: TaskContext, itr: Iterator[Int]) => {
+ ExecutorSuiteHelper.latches.latch1.await(300, TimeUnit.MILLISECONDS)
+ ExecutorSuiteHelper.latches.latch2.countDown()
+ ExecutorSuiteHelper.latches.latch3.await(500, TimeUnit.MILLISECONDS)
+ itr.size
+ }
+ val rdd = new RDD[Int](sc, Nil) {
+ override def compute(split: Partition, context: TaskContext):
Iterator[Int] = {
+ val l = List(1)
+ l.iterator
Review comment:
can just be `Iterator(1)`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]