Jiabao-Sun commented on code in PR #23218: URL: https://github.com/apache/flink/pull/23218#discussion_r1298702048
########## flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java: ########## @@ -355,44 +336,42 @@ public void testKeyGroupedInternalPriorityQueue(boolean addAll) throws Exception if (addAll) { priorityQueue.addAll(asList(elements)); } else { - assertTrue(priorityQueue.add(elements[0])); - assertTrue(priorityQueue.add(elements[1])); - assertFalse(priorityQueue.add(elements[2])); - assertFalse(priorityQueue.add(elements[3])); - assertFalse(priorityQueue.add(elements[4])); + assertThat(priorityQueue.add(elements[0])).isTrue(); + assertThat(priorityQueue.add(elements[1])).isTrue(); + assertThat(priorityQueue.add(elements[2])).isFalse(); + assertThat(priorityQueue.add(elements[3])).isFalse(); + assertThat(priorityQueue.add(elements[4])).isFalse(); } - assertFalse(priorityQueue.isEmpty()); - assertThat( - priorityQueue.getSubsetForKeyGroup(1), - containsInAnyOrder(elementA42, elementA44)); - assertThat( - priorityQueue.getSubsetForKeyGroup(8), - containsInAnyOrder(elementB1, elementB3)); + assertThat(priorityQueue.isEmpty()).isFalse(); + assertThat(priorityQueue.getSubsetForKeyGroup(1)) + .containsExactlyInAnyOrder(elementA42, elementA44); + assertThat(priorityQueue.getSubsetForKeyGroup(8)) + .containsExactlyInAnyOrder(elementB1, elementB3); - assertThat(priorityQueue.peek(), equalTo(elementB1)); - assertThat(priorityQueue.poll(), equalTo(elementB1)); - assertThat(priorityQueue.peek(), equalTo(elementB3)); + assertThat(priorityQueue.peek()).isEqualTo(elementB1); + assertThat(priorityQueue.poll()).isEqualTo(elementB1); + assertThat(priorityQueue.peek()).isEqualTo(elementB3); List<TestType> actualList = new ArrayList<>(); try (CloseableIterator<TestType> iterator = priorityQueue.iterator()) { iterator.forEachRemaining(actualList::add); } - assertThat(actualList, containsInAnyOrder(elementB3, elementA42, elementA44)); + assertThat(actualList).containsExactlyInAnyOrder(elementB3, elementA42, elementA44); - assertEquals(3, priorityQueue.size()); + assertThat(priorityQueue.size()).isEqualTo(3); Review Comment: I'm afraid we cannot do that change because there's no size assertion of org.apache.flink.runtime.stateInternalPriorityQueue. -- 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