You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ro...@apache.org on 2022/03/25 05:54:30 UTC

[flink] branch release-1.15 updated: [FLINK-26809][tests] Assert histogram state after stopping the uploader

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

roman pushed a commit to branch release-1.15
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.15 by this push:
     new 3c88f88  [FLINK-26809][tests] Assert histogram state after stopping the uploader
3c88f88 is described below

commit 3c88f887de26f58cff27c87931d7a2f6928c81da
Author: Roman Khachatryan <kh...@gmail.com>
AuthorDate: Thu Mar 24 10:47:26 2022 +0100

    [FLINK-26809][tests] Assert histogram state after stopping the uploader
    
    There is a race condition in ChangelogStorageMetricsTest.testAttemptsPerUpload:
    - the assertion is made as soon as upload (future) is completed
    - the histogram is updated after completing the upload (on success)
    Moving assertion out of try/close block solves the problem.
---
 .../org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java b/flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java
index 3444139..9c03117 100644
--- a/flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java
+++ b/flink-dstl/flink-dstl-dfs/src/test/java/org/apache/flink/changelog/fs/ChangelogStorageMetricsTest.java
@@ -201,12 +201,12 @@ public class ChangelogStorageMetricsTest {
                 writer.append(0, new byte[] {0, 1, 2, 3});
                 writer.persist(from).get();
             }
-            HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
-            assertEquals(maxAttempts, histogram.getMin());
-            assertEquals(maxAttempts, histogram.getMax());
         } finally {
             storage.close();
         }
+        HistogramStatistics histogram = metrics.getAttemptsPerUpload().getStatistics();
+        assertEquals(maxAttempts, histogram.getMin());
+        assertEquals(maxAttempts, histogram.getMax());
     }
 
     @Test