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

Íñigo Goiri commented on HADOOP-15117:
--------------------------------------

{{AbstractContractPathHandleTest}} gives a very good overview of the expected 
behavior and much cleaner than what we had in {{AbstractContractOpenTest}}.

A couple comments:
* Should we make sure we trigger the exception? For example, should 
{{testMoved}} have a {{fail()}} after the {{verifyRead()}} that expects 
exceptions?
* We do the serialization of the {{PathHandle}} a bunch of times in the tests, 
I'm not sure we should add it to the handle itself but wrapping it in a 
function may make sense.
* Similarly to what you do in {{testChangedAndMoved()}}, you could split (with 
extra lines), the part that does the changes/moves from the ones that do the 
checks.
* Does it make sense to {{fail()}} in the unreachable statement case for 
{{getHandleOrSkip()}}; I don't see how else that could happen but I guess is 
more complete that way.

Nice to see that adding these exhaustive unit tests showed the need to add the 
stat null check to {{HdfsPathHandle}}.

> open(PathHandle) contract test should be exhaustive for default options
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-15117
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15117
>             Project: Hadoop Common
>          Issue Type: Test
>            Reporter: Chris Douglas
>            Assignee: Chris Douglas
>         Attachments: HADOOP-15117.000.patch
>
>
> The current {{AbstractContractOpenTest}} covers many, but not all of the 
> permutations of the default {{HandleOpt}}. It could also be refactored to be 
> clearer as documentation



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to