This is an automated email from the ASF dual-hosted git repository.

sodonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 9baca7c  HDDS-5692. Combine some tests in TestOzoneManagerHAWithData 
to reuse mini-Clusters (#2593)
9baca7c is described below

commit 9baca7cc12e35d827c6ab8db268ad7bc1533f7eb
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Sat Aug 28 17:25:09 2021 +0100

    HDDS-5692. Combine some tests in TestOzoneManagerHAWithData to reuse 
mini-Clusters (#2593)
---
 .../ozone/om/TestOzoneManagerHAWithData.java       | 32 ++++++++++------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
index 48015dc..ba412f5 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
@@ -60,20 +60,15 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
 
   /**
    * Test a client request when all OM nodes are running. The request should
-   * succeed.
+   * succeed. Repeat with one OM node down.
    * @throws Exception
    */
   @Test
-  public void testAllOMNodesRunning() throws Exception {
+  public void testAllOMNodesRunningAndOneDown() throws Exception {
     createVolumeTest(true);
     createKeyTest(true);
-  }
 
-  /**
-   * Test client request succeeds even if one OM is down.
-   */
-  @Test
-  public void testOneOMNodeDown() throws Exception {
+    // Repeat the test with one OM down
     getCluster().stopOzoneManager(1);
     Thread.sleep(NODE_FAILURE_TIMEOUT * 4);
 
@@ -109,11 +104,17 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
 
     createMultipartKeyAndReadKey(ozoneBucket, keyName, uploadID);
 
+    testMultipartUploadWithOneOmNodeDown();
   }
 
-
   @Test
-  public void testFileOperationsWithRecursive() throws Exception {
+  public void testFileOperationsAndDelete() throws Exception {
+    testFileOperationsWithRecursive();
+    testFileOperationsWithNonRecursive();
+    testKeysDelete();
+  }
+
+  private void testFileOperationsWithRecursive() throws Exception {
     OzoneBucket ozoneBucket = setupBucket();
 
     String data = "random data";
@@ -152,8 +153,7 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
 
   }
 
-  @Test
-  public void testKeysDelete() throws Exception {
+  private void testKeysDelete() throws Exception {
     OzoneBucket ozoneBucket = setupBucket();
     String data = "random data";
     String keyName1 = "dir/file1";
@@ -193,8 +193,7 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
   }
 
 
-  @Test
-  public void testFileOperationsWithNonRecursive() throws Exception {
+  private void testFileOperationsWithNonRecursive() throws Exception {
     OzoneBucket ozoneBucket = setupBucket();
 
     String data = "random data";
@@ -250,8 +249,7 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
 
   }
 
-  @Test
-  public void testMultipartUploadWithOneOmNodeDown() throws Exception {
+  private void testMultipartUploadWithOneOmNodeDown() throws Exception {
 
     OzoneBucket ozoneBucket = setupBucket();
 
@@ -279,7 +277,7 @@ public class TestOzoneManagerHAWithData extends 
TestOzoneManagerHA {
     String newLeaderOMNodeId =
         omFailoverProxyProvider.getCurrentProxyOMNodeId();
 
-    Assert.assertTrue(leaderOMNodeId != newLeaderOMNodeId);
+    Assert.assertTrue(!leaderOMNodeId.equals(newLeaderOMNodeId));
   }
 
   /**

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to