HDDS-1158. TestOzoneManagerHA.testTwoOMNodesDown is failing with ratis error.

This commit is contained in:
Hanisha Koneru 2019-02-23 10:20:28 -08:00 committed by Bharat Viswanadham
parent f7a27cdee4
commit d0e21ac16b

View File

@ -25,11 +25,13 @@
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.client.rpc.ha.OMProxyInfo;
import org.apache.hadoop.ozone.client.rpc.ha.OMProxyProvider;
import org.apache.hadoop.ozone.om.exceptions.OMException;
import org.apache.hadoop.ozone.web.handlers.UserArgs;
import org.apache.hadoop.ozone.web.handlers.VolumeArgs;
import org.apache.hadoop.ozone.web.interfaces.StorageHandler;
import org.apache.hadoop.ozone.web.response.VolumeInfo;
import org.apache.hadoop.ozone.web.utils.OzoneUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@ -152,6 +154,7 @@ private void testCreateVolume(boolean checkSuccess) throws Exception {
createVolumeArgs.setUserName(userName);
createVolumeArgs.setAdminName(adminName);
try {
storageHandler.createVolume(createVolumeArgs);
VolumeArgs getVolumeArgs = new VolumeArgs(volumeName, userArgs);
@ -163,6 +166,15 @@ private void testCreateVolume(boolean checkSuccess) throws Exception {
} else {
// Verify that the request failed
Assert.assertTrue(retVolumeinfo.getVolumeName().isEmpty());
Assert.fail("There is no quorum. Request should have failed");
}
} catch (OMException e) {
if (!checkSuccess) {
GenericTestUtils.assertExceptionContains(
"RaftRetryFailureException", e);
} else {
throw e;
}
}
}