From 4e64f8d763fddacb2c326884e057523443ef136f Mon Sep 17 00:00:00 2001 From: Hanisha Koneru Date: Wed, 3 Apr 2019 16:02:19 -0700 Subject: [PATCH] HDDS-1324. TestOzoneManagerHA tests are flaky (#676) --- .../apache/hadoop/ozone/om/TestOzoneManagerHA.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 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 f565ad0961..93c120a7a9 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 @@ -16,7 +16,6 @@ */ package org.apache.hadoop.ozone.om; - import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; @@ -98,8 +97,8 @@ public void init() throws Exception { scmId = UUID.randomUUID().toString(); conf.setBoolean(OZONE_ACL_ENABLED, true); conf.setInt(OZONE_OPEN_KEY_EXPIRE_THRESHOLD_SECONDS, 2); - conf.setInt(OZONE_CLIENT_RETRY_MAX_ATTEMPTS_KEY, 3); - conf.setInt(OZONE_CLIENT_FAILOVER_MAX_ATTEMPTS_KEY, 3); + conf.setInt(OZONE_CLIENT_RETRY_MAX_ATTEMPTS_KEY, 10); + conf.setInt(OZONE_CLIENT_FAILOVER_MAX_ATTEMPTS_KEY, 10); cluster = (MiniOzoneHAClusterImpl) MiniOzoneCluster.newHABuilder(conf) .setClusterId(clusterId) @@ -222,7 +221,7 @@ public void testMultipartUploadWithOneOmNodeDown() throws Exception { // Stop one of the ozone manager, to see when the OM leader changes // multipart upload is happening successfully or not. cluster.stopOzoneManager(leaderOMNodeId); - + Thread.sleep(NODE_FAILURE_TIMEOUT * 2); createMultipartKeyAndReadKey(ozoneBucket, keyName, uploadID); @@ -488,13 +487,13 @@ public void testOMRetryProxy() throws Exception { Assert.fail("TestOMRetryProxy should fail when there are no OMs running"); } catch (ConnectException e) { // Each retry attempt tries upto 10 times to connect. So there should be - // 3*10 "Retrying connect to server" messages - Assert.assertEquals(30, + // 10*10 "Retrying connect to server" messages + Assert.assertEquals(100, appender.countLinesWithMessage("Retrying connect to server:")); Assert.assertEquals(1, appender.countLinesWithMessage("Failed to connect to OM. Attempted " + - "3 retries and 3 failovers")); + "10 retries and 10 failovers")); } }