[ 
https://issues.apache.org/jira/browse/HDDS-9524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Doroszlai updated HDDS-9524:
-----------------------------------
    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!):

{code}
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);
{code}

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()}}

  was:
{{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!):

{code}
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
192:    GenericTestUtils.waitFor(() -> cluster.getOMLeader() != null, 500, 
30000);
419:    GenericTestUtils.waitFor(() -> cluster.getOMLeader() != null, 500, 
30000);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAMetrics.java
102:        getCluster().getOMLeader() != null, 500, timeout);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHASnapshot.java
128:        .until(() -> cluster.getOMLeader() != null);
258:        .until(() -> cluster.getOMLeader() != null);

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
100:    GenericTestUtils.waitFor(() -> cluster.getOMLeader() != null,
{code}

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()}}


> Clean up wait for leader OM in integration tests
> ------------------------------------------------
>
>                 Key: HDDS-9524
>                 URL: https://issues.apache.org/jira/browse/HDDS-9524
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: test
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Major
>              Labels: GoodForNewContributors, good-first-issue
>
> {{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!):
> {code}
> 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);
> {code}
> 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()}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to