Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-2159

Sqoop2: Use BeforeSuite/AfterSuite for startHadoop/stopHadoop in integration tests

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.99.5
    • Fix Version/s: 1.99.6
    • Component/s: None
    • Labels:
      None

      Description

      I've noticed that BeforeClass annotation in test-ng is behaving slightly differently than I was expecting. For most integration tests it behaves as anticipated - it will run before any test methods inside any test class. However when it's used with @DataProvider it will be run for every parametrized call. This means that for example PartitionerTest will initialize the HadoopMiniCluster on all 20 executions, which is adding to the slowness of this test.

      Test-ng have additional annotation called @BeforeSuite that will run only once even if given test class is using @DataProvider and hence I would suggest to use it for startHadoop() method. And similarly @AfterSuite for stopHadoop().

      I did not measure impact on PartitionerTest, but making this change for other integration test that I'm writing got the execution from 10 down to 3 minutes.

        Attachments

        1. SQOOP-2159.patch
          3 kB
          Jarek Jarcec Cecho

          Issue Links

            Activity

              People

              • Assignee:
                jarcec Jarek Jarcec Cecho
                Reporter:
                jarcec Jarek Jarcec Cecho
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: