You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2020/11/09 23:07:24 UTC

[commons-collections] branch master updated: Fix flaky AbstractMultiValuedMapTest#testToString

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

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 9499397  Fix flaky AbstractMultiValuedMapTest#testToString
     new 28f5832  Merge branch 'pr-194'
9499397 is described below

commit 949939727359c5e7b973f810e976452c6e7e4ff3
Author: Xin Tong <xi...@illinois.edu>
AuthorDate: Mon Nov 9 13:36:49 2020 -0600

    Fix flaky AbstractMultiValuedMapTest#testToString
---
 src/changes/changes.xml                                        |  3 +++
 .../collections4/multimap/AbstractMultiValuedMapTest.java      | 10 ++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index dd2f025..22564c8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -21,6 +21,9 @@
   </properties>
   <body>
   <release version="4.5" date="2020-MM-DD" description="Maintenance release.">
+    <action issue="COLLECTIONS-771" dev="kinow" type="fix" due-to="Xin Tong">
+      Fix flaky AbstractMultiValuedMapTest#testToString.
+    </action>
     <action issue="COLLECTIONS-769" dev="kinow" type="fix" due-to="Xin (Cynthia) Tong">
       Fix flaky UnmodifiableMultiValuedMapTest.
     </action>
diff --git a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index 0d845ec..426327a 100644
--- a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -675,7 +675,10 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
         map.put((K) "B", (V) "U");
         map.put((K) "B", (V) "V");
         map.put((K) "B", (V) "W");
-        assertEquals("{A=[X, Y, Z], B=[U, V, W]}", map.toString());
+        assertTrue(
+            "{A=[X, Y, Z], B=[U, V, W]}".equals(map.toString()) ||
+            "{B=[U, V, W], A=[X, Y, Z]}".equals(map.toString())
+        );
 
         try {
             final MultiValuedMap<K, V> originalNull = null;
@@ -684,7 +687,10 @@ public abstract class AbstractMultiValuedMapTest<K, V> extends AbstractObjectTes
         } catch (final NullPointerException npe) {
             // expected
         }
-        assertEquals("{A=[X, Y, Z], B=[U, V, W]}", map.toString());
+        assertTrue(
+            "{A=[X, Y, Z], B=[U, V, W]}".equals(map.toString()) ||
+            "{B=[U, V, W], A=[X, Y, Z]}".equals(map.toString())
+        );
 
         map.remove("A");
         map.remove("B");