Skip to content

Commit

Permalink
[FLINK-18360][history] Eagerly initialize overview files
Browse files Browse the repository at this point in the history
  • Loading branch information
jvimr committed Jun 23, 2020
1 parent 5982cb9 commit efcc543
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ static class JobArchiveFetcherTask extends TimerTask {
webJobDir.mkdir();
this.webOverviewDir = new File(webDir, "overviews");
webOverviewDir.mkdir();
updateJobOverview(webOverviewDir, webDir);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,7 @@ public void tearDown() {
@Test
public void testHistoryServerIntegration() throws Exception {
final int numJobs = 2;
for (int x = 0; x < numJobs; x++) {
runJob();
}
final int numLegacyJobs = 1;
createLegacyArchive(jmDirectory.toPath());

waitForArchivesCreation(numJobs + numLegacyJobs);

CountDownLatch numExpectedArchivedJobs = new CountDownLatch(numJobs + numLegacyJobs);

Expand All @@ -149,8 +143,16 @@ public void testHistoryServerIntegration() throws Exception {
try {
hs.start();
String baseUrl = "https://localhost:" + hs.getWebPort();
assertTrue(numExpectedArchivedJobs.await(10L, TimeUnit.SECONDS));

Assert.assertEquals(0, getJobsOverview(baseUrl).getJobs().size());

for (int x = 0; x < numJobs; x++) {
runJob();
}
createLegacyArchive(jmDirectory.toPath());
waitForArchivesCreation(numJobs + numLegacyJobs);

assertTrue(numExpectedArchivedJobs.await(10L, TimeUnit.SECONDS));
Assert.assertEquals(numJobs + numLegacyJobs, getJobsOverview(baseUrl).getJobs().size());

// checks whether the dashboard configuration contains all expected fields
Expand Down

0 comments on commit efcc543

Please sign in to comment.