@@ -43,7 +43,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
43
43
testDir = Utils .createTempDir()
44
44
provider = new FsHistoryProvider (new SparkConf ()
45
45
.set(" spark.history.fs.logDirectory" , testDir.getAbsolutePath())
46
- .set(" spark.history.fs.updateInterval " , " 0 " ))
46
+ .set(" spark.testing " , " true " ))
47
47
}
48
48
49
49
after {
@@ -62,12 +62,14 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
62
62
SparkListenerApplicationStart (" app1-1" , None , 1L , " test" ),
63
63
SparkListenerApplicationEnd (2L )
64
64
)
65
+ provider.checkForLogs()
65
66
66
67
// Write an unfinished app, new-style.
67
68
val logFile2 = new File (testDir, " new2" + EventLoggingListener .IN_PROGRESS )
68
69
writeFile(logFile2, true , None ,
69
70
SparkListenerApplicationStart (" app2-2" , None , 1L , " test" )
70
71
)
72
+ provider.checkForLogs()
71
73
72
74
// Write an old-style application log.
73
75
val oldLog = new File (testDir, " old1" )
@@ -78,6 +80,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
78
80
SparkListenerApplicationEnd (3L )
79
81
)
80
82
createEmptyFile(new File (oldLog, provider.APPLICATION_COMPLETE ))
83
+ provider.checkForLogs()
81
84
82
85
// Write an unfinished app, old-style.
83
86
val oldLog2 = new File (testDir, " old2" )
@@ -86,9 +89,6 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
86
89
writeFile(new File (oldLog2, provider.LOG_PREFIX + " 1" ), false , None ,
87
90
SparkListenerApplicationStart (" app4" , None , 2L , " test" )
88
91
)
89
-
90
- // Force a reload of data from the log directory, and check that both logs are loaded.
91
- // Take the opportunity to check that the offset checks work as expected.
92
92
provider.checkForLogs()
93
93
94
94
val list = provider.getListing().toSeq
@@ -100,10 +100,10 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
100
100
oldLog.lastModified(), " test" , true ))
101
101
list(1 ) should be (ApplicationHistoryInfo (logFile1.getName(), " app1-1" , 1L , 2L ,
102
102
logFile1.lastModified(), " test" , true ))
103
- list(2 ) should be (ApplicationHistoryInfo (oldLog2.getName(), " app4" , 2L , - 1L ,
104
- oldLog2.lastModified(), " test" , false ))
105
- list(3 ) should be (ApplicationHistoryInfo (logFile2.getName(), " app2-2" , 1L , - 1L ,
103
+ list(2 ) should be (ApplicationHistoryInfo (logFile2.getName(), " app2-2" , 1L , - 1L ,
106
104
logFile2.lastModified(), " test" , false ))
105
+ list(3 ) should be (ApplicationHistoryInfo (oldLog2.getName(), " app4" , 2L , - 1L ,
106
+ oldLog2.lastModified(), " test" , false ))
107
107
108
108
// Make sure the UI can be rendered.
109
109
list.foreach { case info =>
0 commit comments