sadanand48 commented on code in PR #10862:
URL: https://github.com/apache/ozone/pull/10862#discussion_r3712024674
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOMDBCheckpointServletInodeBasedXferNonLeader.java:
##########
@@ -77,4 +81,35 @@ void
processMetadataSnapshotRequestSetsStatusWhenSendErrorFails() throws Excepti
verify(response).setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
}
+
+ @ParameterizedTest
+ @ValueSource(booleans = {false, true})
+ void processMetadataSnapshotRequestDoesNotReturn503WhenLeader(boolean
isLeaderReady) throws Exception {
+ OMDBCheckpointServletInodeBasedXfer servlet =
+ spy(new OMDBCheckpointServletInodeBasedXfer());
+ OzoneManager om = mock(OzoneManager.class);
+ when(om.isLeader()).thenReturn(true);
+ when(om.isLeaderReady()).thenReturn(isLeaderReady);
Review Comment:
I've added a small test to check isLeader() against all 3 RaftServerStatus
values
--
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]