This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new efcc543  [FLINK-18360][history] Eagerly initialize overview files
efcc543 is described below

commit efcc5434dd744ad547999e970c00142a9b20e914
Author: Jindrich Vimr <[email protected]>
AuthorDate: Tue Jun 23 11:10:00 2020 +0200

    [FLINK-18360][history] Eagerly initialize overview files
---
 .../webmonitor/history/HistoryServerArchiveFetcher.java  |  1 +
 .../runtime/webmonitor/history/HistoryServerTest.java    | 16 +++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git 
a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java
 
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java
index a80b625..0dd7e65 100644
--- 
a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java
+++ 
b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcher.java
@@ -190,6 +190,7 @@ class HistoryServerArchiveFetcher {
                        webJobDir.mkdir();
                        this.webOverviewDir = new File(webDir, "overviews");
                        webOverviewDir.mkdir();
+                       updateJobOverview(webOverviewDir, webDir);
                }
 
                @Override
diff --git 
a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/history/HistoryServerTest.java
 
b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/history/HistoryServerTest.java
index 0560833..a2203aa 100644
--- 
a/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/history/HistoryServerTest.java
+++ 
b/flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/history/HistoryServerTest.java
@@ -128,13 +128,7 @@ public class HistoryServerTest extends TestLogger {
        @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);
 
@@ -149,8 +143,16 @@ public class HistoryServerTest extends TestLogger {
                try {
                        hs.start();
                        String baseUrl = "http://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

Reply via email to