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_r304127412
##########
File path: core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala
##########
@@ -600,8 +611,16 @@ private[spark] object JsonProtocolSuite extends
Assertions {
assert(stageAttemptId1 === stageAttemptId2)
assertSeqEquals[AccumulableInfo](updates1, updates2, (a, b) =>
a.equals(b))
})
- assertOptionEquals(e1.executorUpdates, e2.executorUpdates,
- (e1: ExecutorMetrics, e2: ExecutorMetrics) => assertEquals(e1, e2))
+ assertSeqEquals[((Int, Int), ExecutorMetrics)](
+ e1.executorUpdates.toSeq.sortWith((x, y) => lexOrder(x._1, y._1)),
+ e2.executorUpdates.toSeq.sortWith((x, y) => lexOrder(x._1, y._1)),
+ (a, b) => {
+ val (k1, v1) = a
+ val (k2, v2) = b
+ assert(k1 === k2)
+ assertEquals(v1, v2)
+ }
Review comment:
can use pattern matching earlier to clean up a bit more:
```scala
{ case ((k1, v1), (k2, v2)) =>
assert(k1 === k2)
assertEquals(v1, v2)
}
```
----------------------------------------------------------------
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]