hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bha...@apache.org
Subject [hadoop] branch trunk updated: HDDS-1158. TestOzoneManagerHA.testTwoOMNodesDown is failing with ratis error.
Date Sat, 23 Feb 2019 18:20:39 GMT
This is an automated email from the ASF dual-hosted git repository.

bharat pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d0e21ac  HDDS-1158. TestOzoneManagerHA.testTwoOMNodesDown is failing with ratis error.
d0e21ac is described below

commit d0e21ac16bdf064eb195ae29c4022bd8057e35d9
Author: Hanisha Koneru <koneru.hanisha@gmail.com>
AuthorDate: Sat Feb 23 10:20:28 2019 -0800

    HDDS-1158. TestOzoneManagerHA.testTwoOMNodesDown is failing with ratis error.
---
 .../apache/hadoop/ozone/om/TestOzoneManagerHA.java | 30 +++++++++++++++-------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
index a98959b..62cda91 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
@@ -25,11 +25,13 @@ import org.apache.hadoop.ozone.MiniOzoneHAClusterImpl;
 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,17 +154,27 @@ public class TestOzoneManagerHA {
     createVolumeArgs.setUserName(userName);
     createVolumeArgs.setAdminName(adminName);
 
-    storageHandler.createVolume(createVolumeArgs);
+    try {
+      storageHandler.createVolume(createVolumeArgs);
 
-    VolumeArgs getVolumeArgs = new VolumeArgs(volumeName, userArgs);
-    VolumeInfo retVolumeinfo = storageHandler.getVolumeInfo(getVolumeArgs);
+      VolumeArgs getVolumeArgs = new VolumeArgs(volumeName, userArgs);
+      VolumeInfo retVolumeinfo = storageHandler.getVolumeInfo(getVolumeArgs);
 
-    if (checkSuccess) {
-      Assert.assertTrue(retVolumeinfo.getVolumeName().equals(volumeName));
-      Assert.assertTrue(retVolumeinfo.getOwner().getName().equals(userName));
-    } else {
-      // Verify that the request failed
-      Assert.assertTrue(retVolumeinfo.getVolumeName().isEmpty());
+      if (checkSuccess) {
+        Assert.assertTrue(retVolumeinfo.getVolumeName().equals(volumeName));
+        Assert.assertTrue(retVolumeinfo.getOwner().getName().equals(userName));
+      } 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;
+      }
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message