@@ -251,13 +251,12 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
251
251
appListAfterRename.size should be (1 )
252
252
}
253
253
254
- test(" apps with multiple attempts" ) {
254
+ test(" apps with multiple attempts with order " ) {
255
255
val provider = new FsHistoryProvider (createTestConf())
256
256
257
- val attempt1 = newLogFile(" app1" , Some (" attempt1" ), inProgress = false )
257
+ val attempt1 = newLogFile(" app1" , Some (" attempt1" ), inProgress = true )
258
258
writeFile(attempt1, true , None ,
259
- SparkListenerApplicationStart (" app1" , Some (" app1" ), 1L , " test" , Some (" attempt1" )),
260
- SparkListenerApplicationEnd (2L )
259
+ SparkListenerApplicationStart (" app1" , Some (" app1" ), 1L , " test" , Some (" attempt1" ))
261
260
)
262
261
263
262
updateAndCheck(provider) { list =>
@@ -267,27 +266,26 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
267
266
268
267
val attempt2 = newLogFile(" app1" , Some (" attempt2" ), inProgress = true )
269
268
writeFile(attempt2, true , None ,
270
- SparkListenerApplicationStart (" app1" , Some (" app1" ), 3L , " test" , Some (" attempt2" ))
269
+ SparkListenerApplicationStart (" app1" , Some (" app1" ), 2L , " test" , Some (" attempt2" ))
271
270
)
272
271
273
272
updateAndCheck(provider) { list =>
274
273
list.size should be (1 )
275
274
list.head.attempts.size should be (2 )
276
- list.head.attempts.head.attemptId should be (Some (" attempt2 " ))
275
+ list.head.attempts.head.attemptId should be (Some (" attempt1 " ))
277
276
}
278
277
279
- val completedAttempt2 = newLogFile(" app1" , Some (" attempt2" ), inProgress = false )
280
- attempt2.delete()
281
- writeFile(attempt2, true , None ,
282
- SparkListenerApplicationStart (" app1" , Some (" app1" ), 3L , " test" , Some (" attempt2" )),
278
+ val attempt3 = newLogFile(" app1" , Some (" attempt3" ), inProgress = false )
279
+ writeFile(attempt3, true , None ,
280
+ SparkListenerApplicationStart (" app1" , Some (" app1" ), 3L , " test" , Some (" attempt3" )),
283
281
SparkListenerApplicationEnd (4L )
284
282
)
285
283
286
284
updateAndCheck(provider) { list =>
287
285
list should not be (null )
288
286
list.size should be (1 )
289
- list.head.attempts.size should be (2 )
290
- list.head.attempts.head.attemptId should be (Some (" attempt2 " ))
287
+ list.head.attempts.size should be (3 )
288
+ list.head.attempts.head.attemptId should be (Some (" attempt3 " ))
291
289
}
292
290
293
291
val app2Attempt1 = newLogFile(" app2" , Some (" attempt1" ), inProgress = false )
@@ -299,7 +297,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
299
297
updateAndCheck(provider) { list =>
300
298
list.size should be (2 )
301
299
list.head.attempts.size should be (1 )
302
- list.last.attempts.size should be (2 )
300
+ list.last.attempts.size should be (3 )
303
301
list.head.attempts.head.attemptId should be (Some (" attempt1" ))
304
302
305
303
list.foreach { case app =>
@@ -343,7 +341,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with BeforeAndAfter with Matc
343
341
updateAndCheck(provider) { list =>
344
342
list.size should be (1 )
345
343
list.head.attempts.size should be (1 )
346
- list.head.attempts.head.attemptId should be (Some (" attempt2 " ))
344
+ list.head.attempts.head.attemptId should be (Some (" attempt1 " ))
347
345
}
348
346
assert(! log1.exists())
349
347
0 commit comments