errose28 commented on code in PR #12218:
URL: https://github.com/apache/ozone/pull/12218#discussion_r4773724101
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java:
##########
@@ -170,14 +172,25 @@ public void testSCMLeadershipMetric() throws IOException,
InterruptedException {
assertEquals(0, failedSCMs.get());
// THEN expect only one SCM node (leader) will have
'scmha_metrics_scmha_leader_state' metric set to 1
- int leaderCount = 0;
- for (StorageContainerManager scm :
cluster.getStorageContainerManagersList()) {
- if (scm.getScmHAMetrics() != null &&
scm.getScmHAMetrics().getSCMHAMetricsInfoLeaderState() == 1) {
- leaderCount++;
- break;
- }
+ StorageContainerManager oldLeader = cluster.getScmLeader(true);
+ waitForOnlyLeaderMetric(oldLeader);
+
+ // WHEN leadership is transferred to another SCM
+ StorageContainerManager newLeader = inactiveSCMs.get(0);
Review Comment:
Yes, I've updated this to exclude `oldLeader` from selection as the new
leader.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]