XComp commented on a change in pull request #18751:
URL: https://github.com/apache/flink/pull/18751#discussion_r810140328



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/checkpoint/CheckpointIDCounterTestBase.java
##########
@@ -116,23 +114,21 @@ public void testConcurrentGetAndIncrement() throws 
Exception {
             // Get the counts
             for (Future<List<Long>> result : resultFutures) {
                 List<Long> counts = result.get();
+                assertStrictlyMonotonous(counts);
                 all.addAll(counts);
             }
 
             // Verify
             Collections.sort(all);
 
-            assertEquals(expectedTotal, all.size());
+            assertThat(all.size()).isEqualTo(expectedTotal);
 
-            long current = 0;
-            for (long val : all) {
-                // Incrementing counts
-                assertEquals(++current, val);
-            }
+            assertStrictlyMonotonous(all);
 
             // The final count
-            assertEquals(expectedTotal + 1, counter.get());
-            assertEquals(expectedTotal + 1, counter.getAndIncrement());
+            final long lastCheckpointId = all.get(all.size() - 1);
+            assertThat(lastCheckpointId).isLessThan(counter.get());
+            assertThat(lastCheckpointId).isLessThan(counter.getAndIncrement());

Review comment:
       fair enough ... I don't have a preference here.




-- 
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-unsubscr...@flink.apache.org

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


Reply via email to