Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-5345][DEPLOY] Fix unstable test case in FsHistoryProviderSuite #4133

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
testDir = Utils.createTempDir()
provider = new FsHistoryProvider(new SparkConf()
.set("spark.history.fs.logDirectory", testDir.getAbsolutePath())
.set("spark.history.fs.updateInterval", "0"))
.set("spark.testing", "true"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... as Sean mentioned, this should already be defined here. Can you double check that it's really not set, and if not, what's causing it?

}

after {
Expand All @@ -62,12 +62,14 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
SparkListenerApplicationStart("app1-1", None, 1L, "test"),
SparkListenerApplicationEnd(2L)
)
provider.checkForLogs()

// Write an unfinished app, new-style.
val logFile2 = new File(testDir, "new2" + EventLoggingListener.IN_PROGRESS)
writeFile(logFile2, true, None,
SparkListenerApplicationStart("app2-2", None, 1L, "test")
)
provider.checkForLogs()

// Write an old-style application log.
val oldLog = new File(testDir, "old1")
Expand All @@ -78,6 +80,7 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
SparkListenerApplicationEnd(3L)
)
createEmptyFile(new File(oldLog, provider.APPLICATION_COMPLETE))
provider.checkForLogs()

// Write an unfinished app, old-style.
val oldLog2 = new File(testDir, "old2")
Expand All @@ -86,9 +89,6 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
writeFile(new File(oldLog2, provider.LOG_PREFIX + "1"), false, None,
SparkListenerApplicationStart("app4", None, 2L, "test")
)

// Force a reload of data from the log directory, and check that both logs are loaded.
// Take the opportunity to check that the offset checks work as expected.
provider.checkForLogs()

val list = provider.getListing().toSeq
Expand All @@ -100,10 +100,10 @@ class FsHistoryProviderSuite extends FunSuite with BeforeAndAfter with Matchers
oldLog.lastModified(), "test", true))
list(1) should be (ApplicationHistoryInfo(logFile1.getName(), "app1-1", 1L, 2L,
logFile1.lastModified(), "test", true))
list(2) should be (ApplicationHistoryInfo(oldLog2.getName(), "app4", 2L, -1L,
oldLog2.lastModified(), "test", false))
list(3) should be (ApplicationHistoryInfo(logFile2.getName(), "app2-2", 1L, -1L,
list(2) should be (ApplicationHistoryInfo(logFile2.getName(), "app2-2", 1L, -1L,
logFile2.lastModified(), "test", false))
list(3) should be (ApplicationHistoryInfo(oldLog2.getName(), "app4", 2L, -1L,
oldLog2.lastModified(), "test", false))

// Make sure the UI can be rendered.
list.foreach { case info =>
Expand Down