Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-4448

HBaseTestingUtilityFactory - pattern for re-using HBaseTestingUtility instances across unit tests

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

        1. HBaseTestingUtilityFactory.java
          6 kB
          Doug Meil
        2. hbase_hbaseTestingUtility_uses_2011_09_22.xlsx
          39 kB
          Doug Meil
        3. java_HBASE_4448.patch
          12 kB
          Doug Meil
        4. java_HBASE_4448_v2.patch
          12 kB
          Doug Meil

          Issue Links

            Activity

              People

              • Assignee:
                dmeil Doug Meil
                Reporter:
                dmeil Doug Meil
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: