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

    https://github.com/apache/spark/pull/1222#discussion_r21766628
  
    --- 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 --
    
    I'm not sure what you want to test. ReplayListenerBus doesn't care about 
the underlying stream anymore - it has zero code related to compression. So 
adding compression tests here would not be testing anything particular about 
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