[ 
https://issues.apache.org/jira/browse/COLLECTIONS-768?focusedWorklogId=498366&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-498366
 ]

ASF GitHub Bot logged work on COLLECTIONS-768:
----------------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Oct/20 14:01
            Start Date: 09/Oct/20 14:01
    Worklog Time Spent: 10m 
      Work Description: kinow commented on pull request #189:
URL: 
https://github.com/apache/commons-collections/pull/189#issuecomment-705865306


   Hi @tongxin97 
   
   >@kinow Thanks for taking a look. I'm under the impression that a regular 
LinkedHashMap or a TreeMap with custom comparator could preserve insertion 
order.
   
   If so maybe this test could be fixed by changing the data structure given to 
the method you changed? e.g.
   
   ```java
       public void testEntrySet() {
           // Sanity check
           putAndRemove(new TreeMap<>());
           // Actual test
           putAndRemove(new Flat3Map<>(new TreeMap<>()));
       }
   ```
   
   (I tried to reproduce the failure locally, but it didn't happen after I 
tried ~10 times, so not 100% if that fixes it, just a quick code to show what I 
meant)
   
   >Btw I'm new to contributing to Apache projects, so for logistics, are you 
(or someone else from your team) going to accept and merge this PR? Is there 
anything more you need from my side?
   
   You are doing really great! If I were confident in the change, I could merge 
it. Developers may leave pull requests approved without merging too. It depends 
on how confident a developer is to merge the change. Here, I am hoping another 
developer (maybe someone more familiar with Commons Collections) will take a 
look and chime-in with his/her point of view.
   
   If another developer thinks this is a good fix, I'd be OK with this being 
merged. So you don't need to change anything for now, unless you have some 
other ideas on how to fix the issue :+1: 
   
   Thanks!
   Bruno


----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 498366)
    Time Spent: 1h 40m  (was: 1.5h)

> Flat3MapTest.tesetEntrySet() is flaky
> -------------------------------------
>
>                 Key: COLLECTIONS-768
>                 URL: https://issues.apache.org/jira/browse/COLLECTIONS-768
>             Project: Commons Collections
>          Issue Type: Bug
>          Components: Map
>    Affects Versions: 4.4
>            Reporter: XinT
>            Priority: Minor
>              Labels: easyfix, pull-request-available
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> The testEntrySet() function 
> (org.apache.commons.collections4.map.Flat3MapTest#testEntrySet) is flaky 
> because it uses a flaky helper function putAndRemove(). The helper function 
> wrongly assumes that map iterators execute in insertion order, while in fact 
> it can be any order. 
> The current test asserts the last element iterated (and subsequently removed) 
> is the last element inserted. Therefore, the test passes when it so happens 
> that the last iterated element is the last inserted element, but fails 
> otherwise. 
>  
> The proposed fix is: https://github.com/apache/commons-collections/pull/189
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to