hadoop-yarn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prabhu Joseph (JIRA)" <j...@apache.org>
Subject [jira] [Created] (YARN-9470) Fix order of actual and expected expression in assert statements
Date Wed, 10 Apr 2019 12:31:00 GMT
Prabhu Joseph created YARN-9470:
-----------------------------------

             Summary: Fix order of actual and expected expression in assert statements
                 Key: YARN-9470
                 URL: https://issues.apache.org/jira/browse/YARN-9470
             Project: Hadoop YARN
          Issue Type: Improvement
          Components: yarn
    Affects Versions: 3.2.0
            Reporter: Prabhu Joseph
            Assignee: Prabhu Joseph
         Attachments: assertEquals

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. 

{code}
[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>
{code}

For long term, [AssertJ|http://joel-costigliola.github.io/assertj/] can be used for new test
cases which avoids such mistakes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-dev-help@hadoop.apache.org


Mime
View raw message