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

    https://github.com/apache/spark/pull/5432#discussion_r29263018
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala
 ---
    @@ -159,52 +167,52 @@ class FsHistoryProviderSuite extends FunSuite with 
BeforeAndAfter with Matchers
       }
     
       test("SPARK-3697: ignore directories that cannot be read.") {
    -    val logFile1 = newLogFile("new1", inProgress = false)
    +    val logFile1 = newLogFile("new1", None, inProgress = false)
         writeFile(logFile1, true, None,
    -      SparkListenerApplicationStart("app1-1", None, 1L, "test"),
    +      SparkListenerApplicationStart("app1-1", None, 1L, "test", None),
           SparkListenerApplicationEnd(2L)
           )
    -    val logFile2 = newLogFile("new2", inProgress = false)
    +    val logFile2 = newLogFile("new2", None, inProgress = false)
         writeFile(logFile2, true, None,
    -      SparkListenerApplicationStart("app1-2", None, 1L, "test"),
    +      SparkListenerApplicationStart("app1-2", None, 1L, "test", None),
           SparkListenerApplicationEnd(2L)
           )
         logFile2.setReadable(false, false)
     
         val provider = new FsHistoryProvider(createTestConf())
    -    provider.checkForLogs()
    -
    -    val list = provider.getListing().toSeq
    -    list should not be (null)
    -    list.size should be (1)
    +    updateAndCheck(provider) { list =>
    +      list.size should be (1)
    +    }
       }
     
       test("history file is renamed from inprogress to completed") {
         val provider = new FsHistoryProvider(createTestConf())
     
    -    val logFile1 = newLogFile("app1", inProgress = true)
    +    val logFile1 = newLogFile("app1", None, inProgress = true)
         writeFile(logFile1, true, None,
    -      SparkListenerApplicationStart("app1", Some("app1"), 1L, "test"),
    +      SparkListenerApplicationStart("app1", Some("app1"), 1L, "test", 
None),
           SparkListenerApplicationEnd(2L)
         )
    -    provider.checkForLogs()
    -    val appListBeforeRename = provider.getListing()
    -    appListBeforeRename.size should be (1)
    -    appListBeforeRename.head.logPath should 
endWith(EventLoggingListener.IN_PROGRESS)
    +    updateAndCheck(provider) { list =>
    +      list.size should be (1)
    +      
list.head.attempts.head.asInstanceOf[FsApplicationAttemptInfo].logPath should
    +        endWith(EventLoggingListener.IN_PROGRESS)
    +    }
     
    -    logFile1.renameTo(newLogFile("app1", inProgress = false))
    -    provider.checkForLogs()
    -    val appListAfterRename = provider.getListing()
    -    appListAfterRename.size should be (1)
    -    appListAfterRename.head.logPath should not 
endWith(EventLoggingListener.IN_PROGRESS)
    +    logFile1.renameTo(newLogFile("app1", None, inProgress = false))
    +    updateAndCheck(provider) { list =>
    +      list.size should be (1)
    +      
list.head.attempts.head.asInstanceOf[FsApplicationAttemptInfo].logPath should 
not
    +        endWith(EventLoggingListener.IN_PROGRESS)
    +    }
       }
     
       test("SPARK-5582: empty log directory") {
         val provider = new FsHistoryProvider(createTestConf())
     
    -    val logFile1 = newLogFile("app1", inProgress = true)
    +    val logFile1 = newLogFile("app1", None, inProgress = true)
         writeFile(logFile1, true, None,
    -      SparkListenerApplicationStart("app1", Some("app1"), 1L, "test"),
    +      SparkListenerApplicationStart("app1", Some("app1"), 1L, "test", 
None),
           SparkListenerApplicationEnd(2L))
    --- End diff --
    
    Not necessarily. `inProgress = true` just affects the log file name.


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