dongjoon-hyun commented on code in PR #59663:
URL: https://github.com/apache/spark/pull/59663#discussion_r4339138587
##########
core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala:
##########
@@ -931,6 +934,351 @@ class TaskContextSuite extends SparkFunSuite with
BeforeAndAfter with LocalSpark
completion
}
+ private def startDaemonThread(name: String)(body: => Unit): Thread = {
Review Comment:
**11. [Nit] The older second-thread test that was deferred to SPARK-60222 is
unchanged** (L682-689, outside the diff)
In #59332 you
[replied](https://github.com/apache/spark/pull/59332#discussion_r4300465723)
that you would "leave the older 'listener registers another listener using a
second thread' test to SPARK-60222", but it still starts a non-daemon thread
and calls `thread.join()` without a timeout while its listener holds the
invocation. An add cannot block at this head, so this only matters for a future
regression, but with these helpers it is a three-line change:
```scala
val thread =
startDaemonThread("adder")(context.addTaskCompletionListener(simpleListener))
invocations.getAndIncrement()
joinThread(thread)
```
Could it use them?
--
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]