You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/03/24 11:43:19 UTC

[GitHub] [flink] rkhachatryan commented on a change in pull request #19222: [FLINK-26809][tests] Assert histogram state after stopping the uploader

rkhachatryan commented on a change in pull request #19222:
URL: https://github.com/apache/flink/pull/19222#discussion_r834215167



##########
File path: flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java
##########
@@ -204,12 +204,12 @@ void testAttemptsPerUpload() throws Exception {
                 writer.append(0, new byte[] {0, 1, 2, 3});
                 writer.persist(from).get();
             }
-            HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
-            assertThat(histogram.getMin()).isEqualTo(maxAttempts);
-            assertThat(histogram.getMax()).isEqualTo(maxAttempts);
         } finally {
             storage.close();
         }
+        HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
+        assertThat(histogram.getMin()).isEqualTo(maxAttempts);
+        assertThat(histogram.getMax()).isEqualTo(maxAttempts);

Review comment:
       Moving the assertions after `close` requires the thread that finished the upload to stop, i.e. it must have completed handling the upload and updated the metrics.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org