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

[GitHub] [commons-collections] aherbert commented on a diff in pull request #353: [COLLECTIONS-836] fix flaky test DualHashBidiMapTest

aherbert commented on code in PR #353:
URL: https://github.com/apache/commons-collections/pull/353#discussion_r1012827480


##########
src/test/java/org/apache/commons/collections4/bidimap/AbstractBidiMapTest.java:
##########
@@ -265,16 +266,18 @@ private void removeValue(final BidiMap<?, ?> map, final Object value) {
 
     @Test
     public void testBidiKeySetValuesOrder() {
-        resetFull();
-        final Iterator<K> keys = map.keySet().iterator();
-        final Iterator<V> values = map.values().iterator();
-        while (keys.hasNext() && values.hasNext()) {
-            final K key = keys.next();
-            final V value = values.next();
-            assertSame(map.get(key), value);
-        }
-        assertFalse(keys.hasNext());
-        assertFalse(values.hasNext());
+        if((getIterationBehaviour() & AbstractCollectionTest.UNORDERED) == 0){

Review Comment:
   Using an if statement does not allow reporting that the test has been skipped. Can you revert and use the previous suggestion to skip based on an assumption (Junit5):
   ```Java
   public void testBidiKeySetValuesOrder() {
       // Skip if collection is unordered
       Assumptions.assumeFalse((getIterationBehaviour() & AbstractCollectionTest.UNORDERED) != 0);
   ```
   



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

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