diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java index 5150fd4d8f2f..cc2fd7c0c21a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java @@ -18,10 +18,15 @@ package org.apache.hadoop.ozone.freon; +import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; +import org.apache.hadoop.hdds.conf.DatanodeRatisServerConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; +import org.apache.hadoop.hdds.protocol.proto.HddsProtos; import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos; +import org.apache.hadoop.hdds.ratis.RatisHelper; +import org.apache.hadoop.hdds.scm.ScmConfigKeys; import org.apache.hadoop.hdds.scm.pipeline.Pipeline; import org.apache.hadoop.hdds.scm.pipeline.PipelineID; import org.apache.hadoop.hdds.scm.pipeline.PipelineManager; @@ -30,13 +35,14 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; +import java.util.concurrent.TimeUnit; + /** * Tests Freon with Pipeline destroy. */ -@Ignore + public class TestFreonWithPipelineDestroy { private static MiniOzoneCluster cluster; @@ -51,6 +57,27 @@ public class TestFreonWithPipelineDestroy { @BeforeClass public static void init() throws Exception { conf = new OzoneConfiguration(); + conf.setTimeDuration(ScmConfigKeys.OZONE_SCM_PIPELINE_DESTROY_TIMEOUT, + 1, TimeUnit.SECONDS); + conf.setTimeDuration(HddsConfigKeys.HDDS_PIPELINE_REPORT_INTERVAL, + 1, TimeUnit.SECONDS); + conf.setTimeDuration( + RatisHelper.HDDS_DATANODE_RATIS_SERVER_PREFIX_KEY + "." + + DatanodeRatisServerConfig.RATIS_SERVER_REQUEST_TIMEOUT_KEY, + 3, TimeUnit.SECONDS); + conf.setTimeDuration( + RatisHelper.HDDS_DATANODE_RATIS_SERVER_PREFIX_KEY + "." + + DatanodeRatisServerConfig. + RATIS_SERVER_WATCH_REQUEST_TIMEOUT_KEY, + 3, TimeUnit.SECONDS); + conf.setTimeDuration( + RatisHelper.HDDS_DATANODE_RATIS_CLIENT_PREFIX_KEY+ "." + + "rpc.request.timeout", + 3, TimeUnit.SECONDS); + conf.setTimeDuration( + RatisHelper.HDDS_DATANODE_RATIS_CLIENT_PREFIX_KEY+ "." + + "watch.request.timeout", + 3, TimeUnit.SECONDS); cluster = MiniOzoneCluster.newBuilder(conf) .setHbProcessorInterval(1000) .setHbInterval(1000) @@ -74,12 +101,14 @@ public static void shutdown() { public void testRestart() throws Exception { startFreon(); destroyPipeline(); + cluster.waitForPipelineTobeReady(HddsProtos.ReplicationFactor.THREE, + 180000); startFreon(); } private void startFreon() throws Exception { RandomKeyGenerator randomKeyGenerator = - new RandomKeyGenerator((OzoneConfiguration) cluster.getConf()); + new RandomKeyGenerator(cluster.getConf()); randomKeyGenerator.setNumOfVolumes(1); randomKeyGenerator.setNumOfBuckets(1); randomKeyGenerator.setNumOfKeys(1);