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

    https://github.com/apache/spark/pull/1222#discussion_r21765934
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala ---
    @@ -45,13 +45,29 @@ class ReplayListenerSuite extends FunSuite with 
BeforeAndAfter {
       }
     
       test("Simple replay") {
    -    testSimpleReplay()
    -  }
    +    val logFilePath = Utils.getFilePath(testDir, "events.txt")
    +    val fstream = fileSystem.create(logFilePath)
    +    val writer = new PrintWriter(fstream)
    +    val applicationStart = SparkListenerApplicationStart("Greatest App 
(N)ever", None,
    +      125L, "Mickey")
    +    val applicationEnd = SparkListenerApplicationEnd(1000L)
    +    
writer.println(compact(render(JsonProtocol.sparkEventToJson(applicationStart))))
    +    
writer.println(compact(render(JsonProtocol.sparkEventToJson(applicationEnd))))
    +    writer.close()
     
    -  test("Simple replay with compression") {
    -    allCompressionCodecs.foreach { codec =>
    -      testSimpleReplay(Some(codec))
    +    val conf = EventLoggingListenerSuite.getLoggingConf(logFilePath)
    +    val logData = fileSystem.open(logFilePath)
    +    val eventMonster = new EventMonster(conf)
    +    try {
    +      val replayer = new ReplayListenerBus()
    +      replayer.addListener(eventMonster)
    +      replayer.replay(logData, SPARK_VERSION)
    +    } finally {
    +      logData.close()
         }
    +    assert(eventMonster.loggedEvents.size === 2)
    +    assert(eventMonster.loggedEvents(0) === 
JsonProtocol.sparkEventToJson(applicationStart))
    +    assert(eventMonster.loggedEvents(1) === 
JsonProtocol.sparkEventToJson(applicationEnd))
    --- End diff --
    
    We should test compression for simple replay as before. Right now if it 
fails in the end-to-end test we can't be sure if it's caused by some other 
interference that's not related to the `ReplayListenerBus`


---
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