Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-12693 Many misusages of assertEquals(expected, actual)
  3. HADOOP-16509

[hadoop-mapreduce-project] Fix order of actual and expected expression in assert statements

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • None
    • None
    • Reviewed

    Description

      Fix order of actual and expected expression in assert statements which gives misleading message when test case fails. Attached file has some of the places where it is placed wrongly.

      [ERROR] testNodeRemovalGracefully(org.apache.hadoop.yarn.server.resourcemanager.TestResourceTrackerService)  Time elapsed: 3.385 s  <<< FAILURE!
      java.lang.AssertionError: Shutdown nodes should be 0 now expected:<1> but was:<0>
      

      For long term, AssertJ can be used for new test cases which avoids such mistakes.

      This is a follow-up Jira on the fix for the MR project.

      Attachments

        1. old-approx-from-HADOOP-12693
          38 kB
          Adam Antal
        2. MAPREDUCE-7197.001.patch
          182 kB
          Adam Antal
        3. MAPREDUCE-7197.002.patch
          183 kB
          Adam Antal
        4. MAPREDUCE-7197.003.patch
          183 kB
          Adam Antal
        5. MAPREDUCE-7197.004.patch
          188 kB
          Adam Antal
        6. MAPREDUCE-7197.004.patch
          188 kB
          Szilard Nemeth
        7. MAPREDUCE-7197.005.patch
          196 kB
          Adam Antal
        8. MAPREDUCE-7197.006.patch
          198 kB
          Adam Antal

        Issue Links

          Activity

            People

              adam.antal Adam Antal
              adam.antal Adam Antal
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: