chungen0126 commented on code in PR #11171:
URL: https://github.com/apache/ozone/pull/11171#discussion_r4086010116


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -168,6 +169,19 @@ public void setup() throws Exception {
     omMetadataManager = new OmMetadataManagerImpl(ozoneConfiguration, null);
   }
 
+  @Test
+  public void testGetMissingLifecycleConfigurationIsNotLoggedAsError() throws 
Exception {
+    try (LogCapturer logCapturer = 
LogCapturer.captureLogs(OmMetadataManagerImpl.class)) {
+      OMException ex = assertThrows(OMException.class, () ->
+          omMetadataManager.getLifecycleConfiguration("volume1", "bucket1"));
+
+      assertEquals(ResultCodes.LIFECYCLE_CONFIGURATION_NOT_FOUND, 
ex.getResult());
+      // A bucket without a lifecycle configuration is an expected outcome, so 
the
+      // catch-all must not report it with an error and a stack trace.
+      assertThat(logCapturer.getOutput()).doesNotContain("Exception while 
getting lifecycle configuration");
+    }
+  }
+

Review Comment:
   I don't think we need to test whether it gets logged or not. Instead, could 
you please integrate the tests from `TestOzoneManagerGetLifecycleConfiguration` 
into this class?



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