Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-16847

Test TestGroupsCaching fail if HashSet iterates in a different order

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.3.0, 3.2.2
    • Component/s: test
    • Labels:
      None

      Description

      The test `testNegativeGroupCaching` can fail if the iteration order of HashSet changes. In detail, the method `assertEquals` (line 331) compares `groups.getGroups(user)` with an ArrayList `myGroups`. The method `getGroups` converts `allGroups` (a HashSet) to a list and it calls iterator in HashSet. However, the iteration is non-deterministic.

      This PR proposes to modify HashSet to LinkedHashSet for a deterministic order.

        Attachments

        1. HADOOP-16847-000.patch
          1 kB
          testfixer0
        2. HADOOP-16847-000.patch
          1 kB
          testfixer0
        3. HADOOP-16874-001.patch
          1 kB
          testfixer0

          Issue Links

            Activity

              People

              • Assignee:
                testfixer testfixer0
                Reporter:
                testfixer testfixer0
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: