ChenSammi commented on code in PR #6467:
URL: https://github.com/apache/ozone/pull/6467#discussion_r1549003745


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/file/TestOMRecoverLeaseRequest.java:
##########
@@ -356,6 +359,35 @@ public void testLeaseSoftLimitForHsyncRecoverFile(boolean 
force) throws Exceptio
     assertNotNull(keyInfo);
   }
 
+  @Test
+  public void testRecoverLeaseWhenOMNotRunning() throws Exception {
+    populateNamespace(true, true, true, true);
+
+    // enable security
+    
ozoneManager.getConfiguration().setBoolean(OzoneConfigKeys.OZONE_SECURITY_ENABLED_KEY,
 true);
+
+    // set OM as Not Running and enable block token
+    when(ozoneManager.isRunning()).thenReturn(false);
+    when(ozoneManager.isGrpcBlockTokenEnabled()).thenReturn(true);
+
+    GenericTestUtils.LogCapturer logCapturer = 
GenericTestUtils.LogCapturer.captureLogs(OMRecoverLeaseRequest.LOG);
+
+    OMClientResponse omClientResponse = validateAndUpdateCache();
+    OMResponse omResponse = omClientResponse.getOMResponse();
+    assertEquals(OzoneManagerProtocolProtos.Status.OK, omResponse.getStatus());

Review Comment:
   The new patch is tested by Pratyush, and it works, the issue doesn't happen 
again(It's reproducible) .  @jojochuang 



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