zhuzhurk commented on a change in pull request #12278:
URL: https://github.com/apache/flink/pull/12278#discussion_r441316261



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/slotpool/DualKeyLinkedMapTest.java
##########
@@ -85,4 +85,28 @@ public void 
ensuresOneToOneMappingBetweenKeysSameSecondaryKey() {
                assertThat(map.getByKeyB(1), is(secondValue));
                assertThat(map.getByKeyA(2), is(secondValue));
        }
+
+       @Test
+       public void 
testPrimaryKeyOrderIsNotAffectedIfReInsertedWithSameSecondaryKey() {
+               final DualKeyLinkedMap<Integer, Integer, String> map = new 
DualKeyLinkedMap<>(2);
+
+               final String value = "foobar";
+               map.put(1, 1, value);
+               map.put(2, 2, value);
+
+               map.put(1, 1, value);
+               assertThat(map.keySetA().iterator().next(), is(1));
+       }
+
+       @Test
+       public void 
testPrimaryKeyOrderIsNotAffectedIfReInsertedWithDifferentSecondaryKey() {
+               final DualKeyLinkedMap<Integer, Integer, String> map = new 
DualKeyLinkedMap<>(2);
+
+               final String value = "foobar";
+               map.put(1, 1, value);
+               map.put(2, 2, value);
+
+               map.put(1, 3, value);

Review comment:
       This is tested in `ensuresOneToOneMappingBetweenKeysSameSecondaryKey`. 




----------------------------------------------------------------
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.

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


Reply via email to