[ 
https://issues.apache.org/jira/browse/YARN-8732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16634630#comment-16634630
 ] 

Szilard Nemeth edited comment on YARN-8732 at 10/1/18 9:01 PM:
---------------------------------------------------------------

As the testcases in {{ApplicationMasterService}} were tied to either Fair 
scheduler or Capacity scheduler and they were using many helper methods, I 
decided to create a common base class with the helper methods and tests that 
are not specific to any scheduler and created two test classes extending the 
base class.
This way, we have a separate test class for {{FS}} and {{CS}} and have the 
common testcases in the base class.

Some notes for reviewers:
1. The base class contains two abstract methods:
a.) {{createYarnConfig}}: The child test classes create their respective 
{{YarnConfiguration}}s, with the appropriate scheduler in place.
b.) {{getResourceUsageForQueue}}: As the name implies, returns resource usage 
for a given queue. As the implementation differs between {{CS}} / {{FS}}, hence 
this method is abstract.

2. Comparing {{TestApplicationMasterService}} (removed class) and 
{{ApplicationMasterServiceTestBase}} gives a diff that only contains the 
methods moved to the specific scheduler test classes plus some minor formatting 
fixes.



was (Author: snemeth):
As the testcases in {{ApplicationMasterService}} were tied to either Fair 
scheduler or Capacity scheduler and they were using many helper methods, I 
decided to create a common base class with the helper methods and tests that 
are not specific to any scheduler and created two test classes extending the 
base class.
This way, we have a separate test class for {{FS}} and {{CS}} and have the 
common testcases in the base class.

Some notes for reviewers:
1. The base class contains two abstract methods:
a.) {{createYarnConfig}}: The child test classes create their respective yarn 
configs, with the appropriate scheduler in place.
b.) {{getResourceUsageForQueue}}: As the name implies, returns resource usage 
for a given queue. As the implementation differs between {{CS}} / {{FS}}, hence 
this is abstract.

2. Comparing {{TestApplicationMasterService}} (removed class) and 
{{ApplicationMasterServiceTestBase}} gives a diff that only contains the 
methods moved to the specific scheduler test classes plus some minor formatting 
fixes


> Add unit tests of min/max allocation for custom resource types in 
> FairScheduler
> -------------------------------------------------------------------------------
>
>                 Key: YARN-8732
>                 URL: https://issues.apache.org/jira/browse/YARN-8732
>             Project: Hadoop YARN
>          Issue Type: Improvement
>    Affects Versions: 3.2.0
>            Reporter: Szilard Nemeth
>            Assignee: Szilard Nemeth
>            Priority: Minor
>         Attachments: YARN-8732.001.patch
>
>
> Create testcase like this, but for FS: 
> org.apache.hadoop.yarn.server.resourcemanager.TestApplicationMasterService#testValidateRequestCapacityAgainstMinMaxAllocationFor3rdResourceTypes



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to