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

Test TestGroupsCaching fail if HashSet iterates in a different order

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.1
    • 3.3.0, 3.2.2
    • test
    • 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-16874-001.patch
          1 kB
          testfixer0
        2. HADOOP-16847-000.patch
          1 kB
          testfixer0
        3. HADOOP-16847-000.patch
          1 kB
          testfixer0

        Issue Links

          Activity

            People

              testfixer testfixer0
              testfixer testfixer0
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: