From 4fdb5e3470ccc65e23afd067415175d1cb488f53 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 2 Feb 2024 18:04:38 +0100 Subject: [PATCH 1/2] HDDS-10243. Replace GenericTestUtils temp dir in SCMTestUtils --- .../ozone/container/common/SCMTestUtils.java | 13 ------------ .../common/TestDatanodeStateMachine.java | 15 ++----------- .../scm/TestSCMCommonPlacementPolicy.java | 6 ++++-- .../hdds/scm/block/TestBlockManager.java | 7 +++---- .../container/TestContainerManagerImpl.java | 6 ++---- .../container/TestContainerReportHandler.java | 7 ++----- .../container/TestUnknownContainerReport.java | 4 +--- .../TestECMisReplicationHandler.java | 6 ++++-- .../TestECOverReplicationHandler.java | 6 ++++-- .../TestECUnderReplicationHandler.java | 6 ++++-- .../TestLegacyReplicationManager.java | 15 ++++++++----- .../TestMisReplicationHandler.java | 5 +++-- .../TestRatisMisReplicationHandler.java | 6 ++++-- .../TestRatisUnderReplicationHandler.java | 6 ++++-- .../hdds/scm/ha/TestSequenceIDGenerator.java | 13 +++++++++--- .../TestPipelineDatanodesIntersection.java | 4 +--- .../scm/pipeline/TestPipelineManagerImpl.java | 9 ++++---- .../pipeline/TestPipelinePlacementPolicy.java | 4 +--- .../TestPipelineStateManagerImpl.java | 4 +--- .../pipeline/TestSimplePipelineProvider.java | 4 +--- .../server/TestSCMClientProtocolServer.java | 7 +++++-- .../ozone/container/common/TestEndPoint.java | 21 +++++++++++-------- .../hadoop/ozone/TestMiniOzoneCluster.java | 4 ++-- 23 files changed, 84 insertions(+), 94 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/SCMTestUtils.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/SCMTestUtils.java index a7f6f537048c..7917a4ce55cd 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/SCMTestUtils.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/SCMTestUtils.java @@ -22,7 +22,6 @@ import java.net.InetSocketAddress; import java.net.ServerSocket; -import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.conf.ConfigurationSource; @@ -40,12 +39,9 @@ import org.apache.hadoop.ozone.protocol.StorageContainerDatanodeProtocol; import org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolPB; import org.apache.hadoop.ozone.protocolPB.StorageContainerDatanodeProtocolServerSideTranslatorPB; -import org.apache.ozone.test.GenericTestUtils; import com.google.protobuf.BlockingService; -import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric; -import static org.apache.logging.log4j.util.StackLocatorUtil.getCallerClass; import static org.mockito.Mockito.mock; /** @@ -125,15 +121,6 @@ public static InetSocketAddress getReuseableAddress() throws IOException { } } - public static OzoneConfiguration getConf() { - String name = getCallerClass(2).getSimpleName() - + "-" + randomAlphanumeric(10); - File testDir = GenericTestUtils.getTestDir(name); - Runtime.getRuntime().addShutdownHook(new Thread( - () -> FileUtils.deleteQuietly(testDir))); - return getConf(testDir); - } - public static OzoneConfiguration getConf(File testDir) { OzoneConfiguration conf = new OzoneConfiguration(); conf.set(ScmConfigKeys.HDDS_DATANODE_DIR_KEY, diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java index 57e9613c2d73..4f5b87dd3e54 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestDatanodeStateMachine.java @@ -28,7 +28,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.ScmConfigKeys; @@ -55,7 +54,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_KEY; import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_HEARTBEAT_RPC_TIMEOUT; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -80,8 +78,8 @@ public class TestDatanodeStateMachine { private File testRoot; @BeforeEach - public void setUp() throws Exception { - conf = SCMTestUtils.getConf(); + void setUp() throws Exception { + conf = SCMTestUtils.getConf(testRoot); conf.setTimeDuration(OZONE_SCM_HEARTBEAT_RPC_TIMEOUT, 500, TimeUnit.MILLISECONDS); conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT, true); @@ -106,15 +104,6 @@ public void setUp() throws Exception { conf.setStrings(ScmConfigKeys.OZONE_SCM_NAMES, serverAddresses.toArray(new String[0])); - File dataDir = new File(testRoot, "data"); - conf.set(HDDS_DATANODE_DIR_KEY, dataDir.getAbsolutePath()); - if (!dataDir.mkdirs()) { - LOG.info("Data dir create failed."); - } - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, - new File(testRoot, "scm").getAbsolutePath()); - String path = new File(testRoot, "datanodeID").getAbsolutePath(); - conf.set(ScmConfigKeys.OZONE_SCM_DATANODE_ID_DIR, path); executorService = HadoopExecutors.newCachedThreadPool( new ThreadFactoryBuilder().setDaemon(true) .setNameFormat("TestDataNodeStateMachineThread-%d").build()); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestSCMCommonPlacementPolicy.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestSCMCommonPlacementPolicy.java index 6c651cbfacd5..634a723f289c 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestSCMCommonPlacementPolicy.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestSCMCommonPlacementPolicy.java @@ -37,7 +37,9 @@ import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import java.io.File; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -72,9 +74,9 @@ public class TestSCMCommonPlacementPolicy { private OzoneConfiguration conf; @BeforeEach - public void setup() { + void setup(@TempDir File testDir) { nodeManager = new MockNodeManager(true, 10); - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); } @Test diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java index 9d852a154463..6352cbf19745 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java @@ -17,10 +17,10 @@ package org.apache.hadoop.hdds.scm.block; +import java.io.File; import java.io.IOException; import java.time.Clock; import java.time.ZoneId; -import java.nio.file.Path; import java.time.ZoneOffset; import java.util.List; import java.util.Map; @@ -114,14 +114,13 @@ public class TestBlockManager { private ReplicationConfig replicationConfig; @BeforeEach - public void setUp(@TempDir Path tempDir) throws Exception { - conf = SCMTestUtils.getConf(); + void setUp(@TempDir File tempDir) throws Exception { + conf = SCMTestUtils.getConf(tempDir); numContainerPerOwnerInPipeline = conf.getInt( ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT_DEFAULT); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, tempDir.toString()); conf.setBoolean(HddsConfigKeys.HDDS_SCM_SAFEMODE_PIPELINE_CREATION, false); conf.setTimeDuration(HddsConfigKeys.HDDS_PIPELINE_REPORT_INTERVAL, 5, TimeUnit.SECONDS); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerManagerImpl.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerManagerImpl.java index 0f861a5077cd..25a4a80f233e 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerManagerImpl.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerManagerImpl.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.concurrent.TimeoutException; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.ECReplicationConfig; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -74,9 +73,8 @@ public class TestContainerManagerImpl { private ContainerReplicaPendingOps pendingOpsMock; @BeforeEach - public void setUp() throws Exception { - final OzoneConfiguration conf = SCMTestUtils.getConf(); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); + void setUp() throws Exception { + final OzoneConfiguration conf = SCMTestUtils.getConf(testDir); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); scmhaManager = SCMHAManagerStub.getInstance(true); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerReportHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerReportHandler.java index 2bdc42b7077e..695c88d11a3c 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerReportHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerReportHandler.java @@ -16,7 +16,6 @@ */ package org.apache.hadoop.hdds.scm.container; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.ECReplicationConfig; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -94,12 +93,10 @@ public class TestContainerReportHandler { private PipelineManager pipelineManager; @BeforeEach - public void setup() throws IOException, InvalidStateTransitionException, - TimeoutException { - final OzoneConfiguration conf = SCMTestUtils.getConf(); + void setup() throws IOException, InvalidStateTransitionException { + final OzoneConfiguration conf = SCMTestUtils.getConf(testDir); nodeManager = new MockNodeManager(true, 10); containerManager = mock(ContainerManager.class); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); scmhaManager = SCMHAManagerStub.getInstance(true); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestUnknownContainerReport.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestUnknownContainerReport.java index ba16dbff8772..9ea4ea45b563 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestUnknownContainerReport.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/TestUnknownContainerReport.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.util.Iterator; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.protocol.proto.HddsProtos.LifeCycleState; @@ -76,10 +75,9 @@ public class TestUnknownContainerReport { @BeforeEach public void setup() throws IOException { - final OzoneConfiguration conf = SCMTestUtils.getConf(); + final OzoneConfiguration conf = SCMTestUtils.getConf(testDir); this.nodeManager = new MockNodeManager(true, 10); this.containerManager = mock(ContainerManager.class); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); scmhaManager = SCMHAManagerStub.getInstance(true); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECMisReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECMisReplicationHandler.java index b0a77f3a7c09..73f6edb468e4 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECMisReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECMisReplicationHandler.java @@ -31,9 +31,11 @@ import org.apache.ratis.protocol.exceptions.NotLeaderException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -62,10 +64,10 @@ public class TestECMisReplicationHandler extends TestMisReplicationHandler { @BeforeEach - public void setup() throws NodeNotFoundException, + void setup(@TempDir File testDir) throws NodeNotFoundException, CommandTargetOverloadedException, NotLeaderException { ECReplicationConfig repConfig = new ECReplicationConfig(DATA, PARITY); - setup(repConfig); + setup(repConfig, testDir); } @ParameterizedTest diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECOverReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECOverReplicationHandler.java index 5b889c378209..50cead87e034 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECOverReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECOverReplicationHandler.java @@ -41,8 +41,10 @@ import org.apache.ratis.protocol.exceptions.NotLeaderException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.mockito.stubbing.Answer; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; @@ -82,7 +84,7 @@ public class TestECOverReplicationHandler { private Set>> commandsSent; @BeforeEach - public void setup() throws NodeNotFoundException, NotLeaderException, + void setup(@TempDir File testDir) throws NodeNotFoundException, NotLeaderException, CommandTargetOverloadedException { staleNode = null; @@ -103,7 +105,7 @@ public void setup() throws NodeNotFoundException, NotLeaderException, commandsSent); NodeManager nodeManager = new MockNodeManager(true, 10); - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(testDir); ECReplicationConfig repConfig = new ECReplicationConfig(3, 2); container = ReplicationTestUtil .createContainer(HddsProtos.LifeCycleState.CLOSED, repConfig); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java index 3abad7311c73..22c3630e0c6b 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestECUnderReplicationHandler.java @@ -49,9 +49,11 @@ import org.assertj.core.util.Lists; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; @@ -125,7 +127,7 @@ public class TestECUnderReplicationHandler { = new AtomicBoolean(false); @BeforeEach - public void setup() throws NodeNotFoundException, + void setup(@TempDir File testDir) throws NodeNotFoundException, CommandTargetOverloadedException, NotLeaderException { nodeManager = new MockNodeManager(true, 10) { @Override @@ -159,7 +161,7 @@ public NodeStatus getNodeStatus(DatanodeDetails dd) { replicationManager, commandsSent, throwOverloadedExceptionOnReconstruction); - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); repConfig = new ECReplicationConfig(DATA, PARITY); container = createContainer(HddsProtos.LifeCycleState.CLOSED, repConfig); policy = ReplicationTestUtil diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java index 1dcf15ed65bd..8b1e54f5a4ca 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java @@ -77,10 +77,12 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.ValueSource; +import java.io.File; import java.io.IOException; import java.time.Clock; import java.time.Instant; @@ -155,6 +157,10 @@ public class TestLegacyReplicationManager { private DBStore dbStore; private ContainerReplicaPendingOps containerReplicaPendingOps; + @TempDir + private File testDir; + private OzoneConfiguration config; + int getInflightCount(InflightType type) { return replicationManager.getLegacyReplicationManager() .getInflightCount(type); @@ -163,8 +169,8 @@ int getInflightCount(InflightType type) { @BeforeEach void setup() throws IOException, InterruptedException, NodeNotFoundException, InvalidStateTransitionException { - OzoneConfiguration conf = SCMTestUtils.getConf(); - conf.setTimeDuration( + config = SCMTestUtils.getConf(testDir); + config.setTimeDuration( HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, 0, TimeUnit.SECONDS); @@ -175,12 +181,12 @@ void setup() throws IOException, InterruptedException, eventQueue = new EventQueue(); SCMHAManager scmhaManager = SCMHAManagerStub.getInstance(true); dbStore = DBStoreBuilder.createDBStore( - conf, new SCMDBDefinition()); + config, new SCMDBDefinition()); PipelineManager pipelineManager = mock(PipelineManager.class); when(pipelineManager.containsPipeline(any(PipelineID.class))) .thenReturn(true); containerStateManager = ContainerStateManagerImpl.newBuilder() - .setConfiguration(conf) + .setConfiguration(config) .setPipelineManager(pipelineManager) .setRatisServer(scmhaManager.getRatisServer()) .setContainerStore(SCMDBDefinition.CONTAINERS.getTable(dbStore)) @@ -263,7 +269,6 @@ private void createReplicationManager(ReplicationManagerConfiguration rmConf) void createReplicationManager(ReplicationManagerConfiguration rmConf, LegacyReplicationManagerConfiguration lrmConf) throws InterruptedException, IOException { - OzoneConfiguration config = SCMTestUtils.getConf(); config.setTimeDuration( HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, 0, TimeUnit.SECONDS); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestMisReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestMisReplicationHandler.java index a05f9fe9f3a3..7746b1db6215 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestMisReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestMisReplicationHandler.java @@ -38,6 +38,7 @@ import org.apache.hadoop.ozone.protocol.commands.SCMCommand; import org.apache.ratis.protocol.exceptions.NotLeaderException; +import java.io.File; import java.io.IOException; import java.util.HashSet; import java.util.List; @@ -78,10 +79,10 @@ public abstract class TestMisReplicationHandler { new AtomicBoolean(false); private ReplicationManagerMetrics metrics; - protected void setup(ReplicationConfig repConfig) + protected void setup(ReplicationConfig repConfig, File testDir) throws NodeNotFoundException, CommandTargetOverloadedException, NotLeaderException { - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); replicationManager = mock(ReplicationManager.class); when(replicationManager.getNodeStatus(any(DatanodeDetails.class))) diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisMisReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisMisReplicationHandler.java index 9430ad6f7575..d69f0cd7554a 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisMisReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisMisReplicationHandler.java @@ -32,9 +32,11 @@ import org.apache.ratis.protocol.exceptions.NotLeaderException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.List; @@ -59,11 +61,11 @@ public class TestRatisMisReplicationHandler extends TestMisReplicationHandler { @BeforeEach - public void setup() throws NodeNotFoundException, + void setup(@TempDir File testDir) throws NodeNotFoundException, CommandTargetOverloadedException, NotLeaderException { RatisReplicationConfig repConfig = RatisReplicationConfig .getInstance(ReplicationFactor.THREE); - setup(repConfig); + setup(repConfig, testDir); } @ParameterizedTest diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisUnderReplicationHandler.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisUnderReplicationHandler.java index d39ed66ddc6b..d77f093abe38 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisUnderReplicationHandler.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestRatisUnderReplicationHandler.java @@ -41,8 +41,10 @@ import org.apache.ratis.protocol.exceptions.NotLeaderException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; import org.mockito.ArgumentCaptor; +import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; @@ -89,13 +91,13 @@ public class TestRatisUnderReplicationHandler { private ReplicationManagerMetrics metrics; @BeforeEach - public void setup() throws NodeNotFoundException, + void setup(@TempDir File testDir) throws NodeNotFoundException, CommandTargetOverloadedException, NotLeaderException { container = ReplicationTestUtil.createContainer( HddsProtos.LifeCycleState.CLOSED, RATIS_REPLICATION_CONFIG); nodeManager = mock(NodeManager.class); - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); policy = ReplicationTestUtil .getSimpleTestPlacementPolicy(nodeManager, conf); replicationManager = mock(ReplicationManager.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java index 08719eff03d3..2e3c8e843687 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSequenceIDGenerator.java @@ -25,6 +25,9 @@ import org.apache.hadoop.hdds.utils.db.Table; import org.apache.hadoop.ozone.container.common.SCMTestUtils; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.File; import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_SEQUENCE_ID_BATCH_SIZE; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -38,9 +41,13 @@ * Tests for {@link SequenceIdGenerator}. */ public class TestSequenceIDGenerator { + + @TempDir + private File testDir; + @Test public void testSequenceIDGenUponNonRatis() throws Exception { - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(testDir); SCMMetadataStore scmMetadataStore = new SCMMetadataStoreImpl(conf); scmMetadataStore.start(conf); @@ -82,7 +89,7 @@ public void testSequenceIDGenUponNonRatis() throws Exception { @Test public void testSequenceIDGenUponRatis() throws Exception { - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(testDir); // change batchSize to 100 conf.setInt(OZONE_SCM_SEQUENCE_ID_BATCH_SIZE, 100); @@ -129,7 +136,7 @@ public void testSequenceIDGenUponRatis() throws Exception { public void testSequenceIDGenUponRatisWhenCurrentScmIsNotALeader() throws Exception { int batchSize = 100; - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(testDir); conf.setInt(OZONE_SCM_SEQUENCE_ID_BATCH_SIZE, batchSize); SCMMetadataStore scmMetadataStore = new SCMMetadataStoreImpl(conf); scmMetadataStore.start(conf); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineDatanodesIntersection.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineDatanodesIntersection.java index 9afd9c793c08..385e1c653168 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineDatanodesIntersection.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineDatanodesIntersection.java @@ -18,7 +18,6 @@ package org.apache.hadoop.hdds.scm.pipeline; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.proto.HddsProtos; @@ -65,9 +64,8 @@ public class TestPipelineDatanodesIntersection { @BeforeEach public void initialize() throws IOException { - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); end = false; - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); } diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java index 4852bc4360ab..e9407d6a9419 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java @@ -17,7 +17,6 @@ */ package org.apache.hadoop.hdds.scm.pipeline; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.ECReplicationConfig; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.client.ReplicationConfig; @@ -128,11 +127,11 @@ public class TestPipelineManagerImpl { private TestClock testClock; @BeforeEach - void init(@TempDir File testDir) throws Exception { + void init(@TempDir File testDir, @TempDir File dbDir) throws Exception { testClock = new TestClock(Instant.now(), ZoneOffset.UTC); - conf = SCMTestUtils.getConf(); - scm = HddsTestUtils.getScm(conf); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); + conf = SCMTestUtils.getConf(dbDir); + scm = HddsTestUtils.getScm(SCMTestUtils.getConf(testDir)); + // Mock Node Manager is not able to correctly set up things for the EC // placement policy (Rack Scatter), so just use the random one. conf.set(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_EC_IMPL_KEY, diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java index da5db2575a2c..0f9ec84f0332 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java @@ -27,7 +27,6 @@ import java.util.concurrent.TimeoutException; import java.util.stream.Collectors; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.client.ReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -108,12 +107,11 @@ public void init() throws Exception { // start with nodes with rack awareness. nodeManager = new MockNodeManager(cluster, getNodesWithRackAwareness(), false, PIPELINE_PLACEMENT_MAX_NODES_COUNT); - conf = SCMTestUtils.getConf(); + conf = SCMTestUtils.getConf(testDir); conf.setInt(OZONE_DATANODE_PIPELINE_LIMIT, PIPELINE_LOAD_LIMIT); conf.setStorageSize(OZONE_DATANODE_RATIS_VOLUME_FREE_SPACE_MIN, 10, StorageUnit.MB); nodeManager.setNumPipelinePerDatanode(PIPELINE_LOAD_LIMIT); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); scmhaManager = SCMHAManagerStub.getInstance(true); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineStateManagerImpl.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineStateManagerImpl.java index a29f64f81c3d..9feb9e1f0a93 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineStateManagerImpl.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineStateManagerImpl.java @@ -18,7 +18,6 @@ package org.apache.hadoop.hdds.scm.pipeline; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.RatisReplicationConfig; import org.apache.hadoop.hdds.client.ReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -68,8 +67,7 @@ public class TestPipelineStateManagerImpl { @BeforeEach public void init() throws Exception { - final OzoneConfiguration conf = SCMTestUtils.getConf(); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); + final OzoneConfiguration conf = SCMTestUtils.getConf(testDir); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSimplePipelineProvider.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSimplePipelineProvider.java index ceca4ab73ee7..b69ebedb04d8 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSimplePipelineProvider.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSimplePipelineProvider.java @@ -18,7 +18,6 @@ package org.apache.hadoop.hdds.scm.pipeline; -import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.client.StandaloneReplicationConfig; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.protocol.DatanodeDetails; @@ -60,8 +59,7 @@ public class TestSimplePipelineProvider { @BeforeEach public void init() throws Exception { nodeManager = new MockNodeManager(true, 10); - final OzoneConfiguration conf = SCMTestUtils.getConf(); - conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, testDir.getAbsolutePath()); + final OzoneConfiguration conf = SCMTestUtils.getConf(testDir); dbStore = DBStoreBuilder.createDBStore( conf, new SCMDBDefinition()); SCMHAManager scmhaManager = SCMHAManagerStub.getInstance(true); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java index 79be275788a0..7c06b79a2ffb 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMClientProtocolServer.java @@ -31,6 +31,9 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.File; import java.io.IOException; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_READONLY_ADMINISTRATORS; @@ -50,8 +53,8 @@ public class TestSCMClientProtocolServer { private StorageContainerLocationProtocolServerSideTranslatorPB service; @BeforeEach - void setUp() throws Exception { - config = SCMTestUtils.getConf(); + void setUp(@TempDir File testDir) throws Exception { + config = SCMTestUtils.getConf(testDir); SCMConfigurator configurator = new SCMConfigurator(); configurator.setSCMHAManager(SCMHAManagerStub.getInstance(true)); configurator.setScmContext(SCMContext.emptyContext()); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java index 46cd784c47e1..58f65df8fd85 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java @@ -100,6 +100,9 @@ public class TestEndPoint { private static DatanodeLayoutStorage layoutStorage; private static DatanodeDetails dnDetails; + @TempDir + private File tempDir; + @AfterAll public static void tearDown() throws Exception { if (scmServer != null) { @@ -110,7 +113,7 @@ public static void tearDown() throws Exception { @BeforeAll static void setUp() throws Exception { serverAddress = SCMTestUtils.getReuseableAddress(); - ozoneConf = SCMTestUtils.getConf(); + ozoneConf = SCMTestUtils.getConf(testDir); scmServerImpl = new ScmTestMock(); dnDetails = randomDatanodeDetails(); layoutStorage = new DatanodeLayoutStorage(ozoneConf, @@ -128,7 +131,7 @@ static void setUp() throws Exception { @Test public void testGetVersion() throws Exception { try (EndpointStateMachine rpcEndPoint = - createEndpoint(SCMTestUtils.getConf(), + createEndpoint(SCMTestUtils.getConf(tempDir), serverAddress, 1000)) { SCMVersionResponseProto responseProto = rpcEndPoint.getEndPoint() .getVersion(null); @@ -316,7 +319,7 @@ public void testDnLayoutVersionFile() throws Exception { */ @Test public void testGetVersionToInvalidEndpoint() throws Exception { - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(tempDir); InetSocketAddress nonExistentServerAddress = SCMTestUtils .getReuseableAddress(); try (EndpointStateMachine rpcEndPoint = createEndpoint(conf, @@ -344,7 +347,7 @@ public void testGetVersionToInvalidEndpoint() throws Exception { public void testGetVersionAssertRpcTimeOut() throws Exception { final long rpcTimeout = 1000; final long tolerance = 100; - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(tempDir); try (EndpointStateMachine rpcEndPoint = createEndpoint(conf, serverAddress, (int) rpcTimeout)) { @@ -369,7 +372,7 @@ public void testGetVersionAssertRpcTimeOut() throws Exception { public void testRegister() throws Exception { DatanodeDetails nodeToRegister = randomDatanodeDetails(); try (EndpointStateMachine rpcEndPoint = createEndpoint( - SCMTestUtils.getConf(), serverAddress, 1000)) { + SCMTestUtils.getConf(tempDir), serverAddress, 1000)) { SCMRegisteredResponseProto responseProto = rpcEndPoint.getEndPoint() .register(nodeToRegister.getExtendedProtoBufMessage(), HddsTestUtils .createNodeReport( @@ -403,7 +406,7 @@ private MetadataStorageReportProto getMetadataStorageReports(UUID id) { private EndpointStateMachine registerTaskHelper(InetSocketAddress scmAddress, int rpcTimeout, boolean clearDatanodeDetails ) throws Exception { - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(tempDir); EndpointStateMachine rpcEndPoint = createEndpoint(conf, scmAddress, rpcTimeout); @@ -481,7 +484,7 @@ public void testRegisterRpcTimeout() throws Exception { public void testHeartbeat() throws Exception { DatanodeDetails dataNode = randomDatanodeDetails(); try (EndpointStateMachine rpcEndPoint = - createEndpoint(SCMTestUtils.getConf(), + createEndpoint(SCMTestUtils.getConf(tempDir), serverAddress, 1000)) { SCMHeartbeatRequestProto request = SCMHeartbeatRequestProto.newBuilder() .setDatanodeDetails(dataNode.getProtoBufMessage()) @@ -501,7 +504,7 @@ public void testHeartbeat() throws Exception { public void testHeartbeatWithCommandStatusReport() throws Exception { DatanodeDetails dataNode = randomDatanodeDetails(); try (EndpointStateMachine rpcEndPoint = - createEndpoint(SCMTestUtils.getConf(), + createEndpoint(SCMTestUtils.getConf(tempDir), serverAddress, 1000)) { // Add some scmCommands for heartbeat response addScmCommands(); @@ -572,7 +575,7 @@ private StateContext heartbeatTaskHelper( InetSocketAddress scmAddress, int rpcTimeout ) throws Exception { - OzoneConfiguration conf = SCMTestUtils.getConf(); + OzoneConfiguration conf = SCMTestUtils.getConf(tempDir); // Mini Ozone cluster will not come up if the port is not true, since // Ratis will exit if the server port cannot be bound. We can remove this // hard coding once we fix the Ratis default behaviour. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java index b8cf7906c0a2..d2af65629767 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java @@ -109,8 +109,8 @@ public void testStartMultipleDatanodes() throws Exception { } @Test - public void testContainerRandomPort() throws IOException { - OzoneConfiguration ozoneConf = SCMTestUtils.getConf(); + void testContainerRandomPort(@TempDir File tempDir) throws IOException { + OzoneConfiguration ozoneConf = SCMTestUtils.getConf(tempDir); // Each instance of SM will create an ozone container // that bounds to a random port. From 9b817bb56d0cbc0ecaa2eb5b870050ca8427d32c Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 2 Feb 2024 19:31:31 +0100 Subject: [PATCH 2/2] fix TestLegacyReplicationManager --- .../TestLegacyReplicationManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java index 8b1e54f5a4ca..8aac64de702b 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/replication/TestLegacyReplicationManager.java @@ -158,8 +158,7 @@ public class TestLegacyReplicationManager { private ContainerReplicaPendingOps containerReplicaPendingOps; @TempDir - private File testDir; - private OzoneConfiguration config; + private File tempDir; int getInflightCount(InflightType type) { return replicationManager.getLegacyReplicationManager() @@ -167,10 +166,10 @@ int getInflightCount(InflightType type) { } @BeforeEach - void setup() throws IOException, InterruptedException, + void setup(@TempDir File testDir) throws IOException, InterruptedException, NodeNotFoundException, InvalidStateTransitionException { - config = SCMTestUtils.getConf(testDir); - config.setTimeDuration( + OzoneConfiguration conf = SCMTestUtils.getConf(testDir); + conf.setTimeDuration( HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, 0, TimeUnit.SECONDS); @@ -181,12 +180,12 @@ void setup() throws IOException, InterruptedException, eventQueue = new EventQueue(); SCMHAManager scmhaManager = SCMHAManagerStub.getInstance(true); dbStore = DBStoreBuilder.createDBStore( - config, new SCMDBDefinition()); + conf, new SCMDBDefinition()); PipelineManager pipelineManager = mock(PipelineManager.class); when(pipelineManager.containsPipeline(any(PipelineID.class))) .thenReturn(true); containerStateManager = ContainerStateManagerImpl.newBuilder() - .setConfiguration(config) + .setConfiguration(conf) .setPipelineManager(pipelineManager) .setRatisServer(scmhaManager.getRatisServer()) .setContainerStore(SCMDBDefinition.CONTAINERS.getTable(dbStore)) @@ -266,9 +265,10 @@ private void createReplicationManager(ReplicationManagerConfiguration rmConf) createReplicationManager(rmConf, null); } - void createReplicationManager(ReplicationManagerConfiguration rmConf, + private void createReplicationManager(ReplicationManagerConfiguration rmConf, LegacyReplicationManagerConfiguration lrmConf) throws InterruptedException, IOException { + OzoneConfiguration config = SCMTestUtils.getConf(tempDir); config.setTimeDuration( HddsConfigKeys.HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, 0, TimeUnit.SECONDS);