[jira] [Commented] (HDFS-5564) Refactor tests in TestCacheDirectives

2013-12-17 Thread Colin Patrick McCabe (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13850911#comment-13850911
 ] 

Colin Patrick McCabe commented on HDFS-5564:


we did this refactor as part of HDFS-5431

 Refactor tests in TestCacheDirectives
 -

 Key: HDFS-5564
 URL: https://issues.apache.org/jira/browse/HDFS-5564
 Project: Hadoop HDFS
  Issue Type: Sub-task
  Components: datanode, namenode
Affects Versions: 3.0.0
Reporter: Andrew Wang
Assignee: Andrew Wang
Priority: Trivial

 Some of the tests in TestCacheDirectives start their own MiniDFSCluster to 
 get a new config, even though we already start a cluster in the @Before 
 function. This contributes to longer test runs and code duplication.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)


[jira] [Commented] (HDFS-5564) Refactor tests in TestCacheDirectives

2013-12-02 Thread Colin Patrick McCabe (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13836820#comment-13836820
 ] 

Colin Patrick McCabe commented on HDFS-5564:


another miscellaneous cleanup to do here: 
{{DistributedFileSystem#addCacheDirective}} should fail if an ID is set.  It's 
a trivial fix (validate that it's not set in {{CacheManager#addDirective}}, a 
function the edit log loader code does not use.)  We also should add a unit 
test for this.

 Refactor tests in TestCacheDirectives
 -

 Key: HDFS-5564
 URL: https://issues.apache.org/jira/browse/HDFS-5564
 Project: Hadoop HDFS
  Issue Type: Sub-task
  Components: datanode, namenode
Affects Versions: 3.0.0
Reporter: Andrew Wang
Assignee: Andrew Wang
Priority: Trivial

 Some of the tests in TestCacheDirectives start their own MiniDFSCluster to 
 get a new config, even though we already start a cluster in the @Before 
 function. This contributes to longer test runs and code duplication.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (HDFS-5564) Refactor tests in TestCacheDirectives

2013-12-02 Thread Andrew Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13836828#comment-13836828
 ] 

Andrew Wang commented on HDFS-5564:
---

If we want to just turn this into a more general cleanup patch, we should also 
consider turning down the log level of cache reports to DEBUG. It's pretty 
spammy right now.

 Refactor tests in TestCacheDirectives
 -

 Key: HDFS-5564
 URL: https://issues.apache.org/jira/browse/HDFS-5564
 Project: Hadoop HDFS
  Issue Type: Sub-task
  Components: datanode, namenode
Affects Versions: 3.0.0
Reporter: Andrew Wang
Assignee: Andrew Wang
Priority: Trivial

 Some of the tests in TestCacheDirectives start their own MiniDFSCluster to 
 get a new config, even though we already start a cluster in the @Before 
 function. This contributes to longer test runs and code duplication.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (HDFS-5564) Refactor tests in TestCacheDirectives

2013-11-27 Thread Colin Patrick McCabe (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13833958#comment-13833958
 ] 

Colin Patrick McCabe commented on HDFS-5564:


To be honest, I have never liked the style of test where a Before function 
sets up a {{MiniDFSCluster}}.  It doesn't allow you to set a different 
configuration, which a lot of these tests have to do.  It hides a potentially 
expensive operation in a function that people modifying the tests may or may 
not look at.  And if you want to add a test that doesn't use a 
{{MiniDFSCluster}], you can't (in other words, you have to ignore the cluster 
that gets started anyway).

I think it would be better to have a common startup function and/or object 
which the tests which want a standardized setup can use, and forget about the 
Before annotation.  Unless there is some way of the test passing information to 
the before function which I'm unaware of?

 Refactor tests in TestCacheDirectives
 -

 Key: HDFS-5564
 URL: https://issues.apache.org/jira/browse/HDFS-5564
 Project: Hadoop HDFS
  Issue Type: Sub-task
  Components: datanode, namenode
Affects Versions: 3.0.0
Reporter: Andrew Wang
Assignee: Andrew Wang
Priority: Trivial

 Some of the tests in TestCacheDirectives start their own MiniDFSCluster to 
 get a new config, even though we already start a cluster in the @Before 
 function. This contributes to longer test runs and code duplication.



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (HDFS-5564) Refactor tests in TestCacheDirectives

2013-11-27 Thread Andrew Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HDFS-5564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13834066#comment-13834066
 ] 

Andrew Wang commented on HDFS-5564:
---

My quick audit of that test file was that there are two configs being used, 
probably from when the two test files were merged originally. In this case, I 
think it's better to just re-split them and relegate the common setup/teardown 
to shared @Before and @After methods.

I agree though that generally, if each test needs a different conf or setup, 
then we should just do it in each test separately. If this comes up, then we 
can split off another test file to do so. Maybe even as part of this refactor 
if we find any tests like that.

 Refactor tests in TestCacheDirectives
 -

 Key: HDFS-5564
 URL: https://issues.apache.org/jira/browse/HDFS-5564
 Project: Hadoop HDFS
  Issue Type: Sub-task
  Components: datanode, namenode
Affects Versions: 3.0.0
Reporter: Andrew Wang
Assignee: Andrew Wang
Priority: Trivial

 Some of the tests in TestCacheDirectives start their own MiniDFSCluster to 
 get a new config, even though we already start a cluster in the @Before 
 function. This contributes to longer test runs and code duplication.



--
This message was sent by Atlassian JIRA
(v6.1#6144)