Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-9931 Improve unit/integration tests
  3. HDDS-9524

Clean up wait for leader OM in integration tests

    XMLWordPrintableJSON

Details

    Description

      MiniOzoneHAClusterImpl:

      • getOMLeader() returns current OM leader.
      • getOMLeader(boolean) optionally waits until OM leader is elected

      There are some tests that implement the same "wait for leader OM" logic using the non-waiting getOMLeader(). Some examples (there may be more!):

      hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
      209:    GenericTestUtils.waitFor(() -> cluster.getOMLeader() != null, 500, 30000);
      437:    GenericTestUtils.waitFor(() -> cluster.getOMLeader() != null, 500, 30000);
      
      hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
      466:        getCluster().getOMLeader() != null, 500, timeout);
      
      hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java
      126:    await(120_000, 100, () -> cluster.getOMLeader() != null);
      253:    await(180_000, 100, () -> cluster.getOMLeader() != null);
      

      Goals of this task:

      • rename getOMLeader(boolean) to waitForLeaderOM() (the method is only called with true)
      • make waitForLeaderOM() public
      • replace duplicated wait logic in tests with a call to waitForLeaderOM()

      Attachments

        Issue Links

          Activity

            People

              david666 David
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: