Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-28770][CORE][TESTS]Ignore SparkListenerStageExecutorMetrics in testApplicationReplay test #25659

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import java.net.URI
import java.util.concurrent.atomic.AtomicInteger

import org.apache.hadoop.fs.Path
import org.json4s.DefaultFormats
import org.json4s.JsonAST.JValue
import org.json4s.jackson.JsonMethods._
import org.scalatest.BeforeAndAfter
Expand Down Expand Up @@ -218,8 +219,17 @@ class ReplayListenerSuite extends SparkFunSuite with BeforeAndAfter with LocalSp

// Verify the same events are replayed in the same order
assert(sc.eventLogger.isDefined)
val originalEvents = sc.eventLogger.get.loggedEvents
val replayedEvents = eventMonster.loggedEvents
implicit val format = DefaultFormats
def exceptCase(a: JValue) = ( a \ "Event").extract[String] match {
// If we are logging stage executor metrics, there is a bulk call to logEvent with
// SparkListenerStageExecutorMetrics events via a Map.foreach. The Map.foreach bulk
// operation may not log the events with the same order. So here we should not compare
// SparkListenerStageExecutorMetrics here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is based on my earlier analysis in the JIRA, which is not quite correct.

case "SparkListenerStageExecutorMetrics" => false
case _ => true
}
val originalEvents = sc.eventLogger.get.loggedEvents.filter(exceptCase(_))
val replayedEvents = eventMonster.loggedEvents.filter(exceptCase(_))
originalEvents.zip(replayedEvents).foreach { case (e1, e2) =>
// Don't compare the JSON here because accumulators in StageInfo may be out of order
JsonProtocolSuite.assertEquals(
Expand Down