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

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

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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 hadoop-tools project.

        Attachments

        1. HADOOP-16512.002.patch
          15 kB
          kevin su
        2. HADOOP-16512.001.patch
          15 kB
          kevin su

          Activity

            People

            • Assignee:
              pingsutw kevin su
              Reporter:
              adam.antal Adam Antal
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: