Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/20940#discussion_r179802392 --- Diff: core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala --- @@ -654,6 +681,25 @@ private[spark] object JsonProtocolSuite extends Assertions { assert(metrics1.bytesRead === metrics2.bytesRead) } + private def assertEquals(metrics1: Option[ExecutorMetrics], metrics2: Option[ExecutorMetrics]) { + metrics1 match { + case Some(m1) => + metrics2 match { + case Some(m2) => + assert(m1.timestamp === m2.timestamp) + assert(m1.jvmUsedMemory === m2.jvmUsedMemory) + assert(m1.onHeapExecutionMemory === m2.onHeapExecutionMemory) + assert(m1.offHeapExecutionMemory === m2.offHeapExecutionMemory) + assert(m1.onHeapStorageMemory === m2.onHeapStorageMemory) + assert(m1.offHeapStorageMemory === m2.offHeapStorageMemory) + case None => + assert(false) + } + case None => + assert(metrics2.isEmpty) --- End diff -- this version looks correct, but I think the matching I mentioned above is a little cleaner. And then you should be able to have `EventLoggingListenerSuite` jsut use this method rather than repeating.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org