hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Meil (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4448) HBaseTestingUtilityFactory - pattern for re-using HBaseTestingUtility instances across unit tests
Date Thu, 22 Sep 2011 20:38:26 GMT

    [ https://issues.apache.org/jira/browse/HBASE-4448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112884#comment-13112884

Doug Meil commented on HBASE-4448:

I agree that some tests will need special configuration for special situations.

But based on the sheet, I think there is still a benefit in going this route.  There are still
39 MiniCluster instances that could be shared between tests, and that's not even considering
MiniZk instances which could also be shared.  That's roughly 10 or 11 minutes of extra startup
& teardown time right there, and we're just getting started.  

I think it might be worth reviewing the tests in terms of what the tests need vs. what they
were coded for, especially with Client and REST packages.  Does the REST unit test really
need a MiniCluster with 3 slaves?  I would hazard a guess that there was some copy-paste going

There isn't any single thing that can fix the build, but I still think this approach seems
like a reasonable start.

> HBaseTestingUtilityFactory - pattern for re-using HBaseTestingUtility instances across
unit tests
> -------------------------------------------------------------------------------------------------
>                 Key: HBASE-4448
>                 URL: https://issues.apache.org/jira/browse/HBASE-4448
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Doug Meil
>            Assignee: Doug Meil
>            Priority: Minor
>         Attachments: HBaseTestingUtilityFactory.java, hbase_hbaseTestingUtility_uses_2011_09_22.xlsx
> Setting up and tearing down HBaseTestingUtility instances in unit tests is very expensive.
 On my MacBook it takes about 10 seconds to set up a MiniCluster, and 7 seconds to tear it
down.  When multiplied by the number of test classes that use this facility, that's a lot
of time in the build.
> This factory assumes that the JVM is being re-used across test classes in the build,
otherwise this pattern won't work. 
> I don't think this is appropriate for every use, but I think it can be applicable in
a great many cases - especially where developers just want a simple MiniCluster with 1 slave.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message