F64116045 commented on code in PR #12134:
URL: https://github.com/apache/ozone/pull/12134#discussion_r4680619498


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSCMConfiguration.java:
##########
@@ -202,27 +201,35 @@ public void testSCMConfig() throws Exception {
 
     assertEquals(port++,
         conf.getInt(ConfUtils.addKeySuffixes(OZONE_SCM_RATIS_PORT_KEY,
-        scmServiceId, "scm1"), 9999));
-
+            scmServiceId, "scm1"), 9999));
+  }
 
+  @Test
+  public void testScmRatisServerConfigRaftProperties() {
     final ScmRatisServerConfig scmRatisConfig = conf.getObject(
         ScmRatisServerConfig.class);
     assertEquals(0, scmRatisConfig.getLogAppenderWaitTimeMin(),
         "getLogAppenderWaitTimeMin");
-
-    conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, tempDir.getPath());
-
-    final RaftProperties p = RatisUtil.newRaftProperties(conf);
-    final TimeDuration t = RaftServerConfigKeys.Log.Appender.waitTimeMin(p);
-    assertEquals(TimeDuration.ZERO, t,
+    assertEquals(TimeDuration.ZERO,
+        RaftServerConfigKeys.Log.Appender.waitTimeMin(
+            RatisUtil.newRaftProperties(conf)),
+        RaftServerConfigKeys.Log.Appender.WAIT_TIME_MIN_KEY);
+    scmRatisConfig.setLogAppenderWaitTimeMin(7);
+    conf.setFromObject(scmRatisConfig);
+    assertEquals(TimeDuration.valueOf(7, TimeUnit.MILLISECONDS),
+        RaftServerConfigKeys.Log.Appender.waitTimeMin(
+            RatisUtil.newRaftProperties(conf)),
         RaftServerConfigKeys.Log.Appender.WAIT_TIME_MIN_KEY);
 
-    assertFalse(scmRatisConfig.isAppendEntriesComposeEnabled(), 
"isAppendEntriesComposeEnabled");
-    assertFalse(RaftServerConfigKeys.Log.appendEntriesComposeEnabled(p),
+    assertFalse(scmRatisConfig.isAppendEntriesComposeEnabled(),
+        "isAppendEntriesComposeEnabled");
+    assertFalse(RaftServerConfigKeys.Log.appendEntriesComposeEnabled(
+            RatisUtil.newRaftProperties(conf)),
         RaftServerConfigKeys.Log.APPEND_ENTRIES_COMPOSE_ENABLED_KEY);
     scmRatisConfig.setAppendEntriesComposeEnabled(true);
     conf.setFromObject(scmRatisConfig);
-    
assertTrue(RaftServerConfigKeys.Log.appendEntriesComposeEnabled(RatisUtil.newRaftProperties(conf)),
+    assertTrue(RaftServerConfigKeys.Log.appendEntriesComposeEnabled(
+            RatisUtil.newRaftProperties(conf)),
         RaftServerConfigKeys.Log.APPEND_ENTRIES_COMPOSE_ENABLED_KEY);
   }

Review Comment:
   thanks @mitsa-ng. I think this test would still pass without the fix, since 
the default xml already puts the key in conf?



-- 
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]

Reply via email to