Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1222#discussion_r21765814
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala 
---
    @@ -279,16 +176,22 @@ class EventLoggingListenerSuite extends FunSuite with 
BeforeAndAfter {
     
         // Ensure all asserts have actually been triggered
         eventExistenceListener.assertAllCallbacksInvoked()
    -  }
     
    -  /**
    -   * Assert that all of the specified events are logged by the given 
EventLoggingListener.
    -   */
    -  private def assertEventsExist(eventLogger: EventLoggingListener, events: 
Seq[String]) {
    -    val eventLoggingInfo = 
EventLoggingListener.parseLoggingInfo(eventLogger.logDir, fileSystem)
    -    assert(eventLoggingInfo.logPaths.size > 0)
    -    val lines = readFileLines(eventLoggingInfo.logPaths.head, 
eventLoggingInfo.compressionCodec)
    -    val eventSet = mutable.Set(events: _*)
    +    // Make sure expected events exist in the log file.
    +    val (logData, version) = EventLoggingListener.openEventLog(new 
Path(eventLogger.logPath),
    +      fileSystem)
    +    val lines = readLines(logData)
    +    val eventSet = mutable.Set(
    +      Utils.getFormattedClassName(SparkListenerApplicationStart),
    +      Utils.getFormattedClassName(SparkListenerBlockManagerAdded),
    +      Utils.getFormattedClassName(SparkListenerEnvironmentUpdate),
    +      Utils.getFormattedClassName(SparkListenerJobStart),
    +      Utils.getFormattedClassName(SparkListenerJobEnd),
    +      Utils.getFormattedClassName(SparkListenerStageSubmitted),
    +      Utils.getFormattedClassName(SparkListenerStageCompleted),
    +      Utils.getFormattedClassName(SparkListenerTaskStart),
    +      Utils.getFormattedClassName(SparkListenerTaskEnd),
    +      Utils.getFormattedClassName(SparkListenerApplicationEnd))
    --- End diff --
    
    can you just do `mutable.Set(...).map(Utils.getFormattedClassName)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to