From e33b61f3351c09b00717f6eef32ff7d24345d06e Mon Sep 17 00:00:00 2001 From: Anu Engineer Date: Tue, 30 Oct 2018 19:16:52 -0700 Subject: [PATCH] HDDS-762. Fix unit test failure for TestContainerSQLCli & TestSCMMetrics. Contributed by Mukul Kumar Singh. --- hadoop-hdds/pom.xml | 2 +- .../common/transport/server/ratis/TestCSMMetrics.java | 10 +++++++--- hadoop-ozone/pom.xml | 2 +- .../apache/hadoop/ozone/scm/TestContainerSQLCli.java | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/hadoop-hdds/pom.xml b/hadoop-hdds/pom.xml index f960e9052a4..090a53772b4 100644 --- a/hadoop-hdds/pom.xml +++ b/hadoop-hdds/pom.xml @@ -45,7 +45,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> 0.4.0-SNAPSHOT - 0.3.0-2272086-SNAPSHOT + 0.3.0-1d2ebee-SNAPSHOT 1.60 diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java index a5a964174a0..67db7ff2dd5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/TestCSMMetrics.java @@ -47,6 +47,7 @@ import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import static org.apache.ratis.rpc.SupportedRpcType.GRPC; +import org.apache.ratis.protocol.RaftGroupId; import org.apache.ratis.util.CheckedBiConsumer; import java.util.function.BiConsumer; @@ -104,7 +105,8 @@ public class TestCSMMetrics { client.connect(); // Before Read Chunk/Write Chunk - MetricsRecordBuilder metric = getMetrics(CSMMetrics.SOURCE_NAME); + MetricsRecordBuilder metric = getMetrics(CSMMetrics.SOURCE_NAME + + RaftGroupId.valueOf(pipeline.getId().getId()).toString()); assertCounter("NumWriteStateMachineOps", 0L, metric); assertCounter("NumReadStateMachineOps", 0L, metric); assertCounter("NumApplyTransactionOps", 0L, metric); @@ -120,7 +122,8 @@ public class TestCSMMetrics { Assert.assertEquals(ContainerProtos.Result.SUCCESS, response.getResult()); - metric = getMetrics(CSMMetrics.SOURCE_NAME); + metric = getMetrics(CSMMetrics.SOURCE_NAME + + RaftGroupId.valueOf(pipeline.getId().getId()).toString()); assertCounter("NumWriteStateMachineOps", 1L, metric); assertCounter("NumApplyTransactionOps", 1L, metric); @@ -132,7 +135,8 @@ public class TestCSMMetrics { Assert.assertEquals(ContainerProtos.Result.SUCCESS, response.getResult()); - metric = getMetrics(CSMMetrics.SOURCE_NAME); + metric = getMetrics(CSMMetrics.SOURCE_NAME + + RaftGroupId.valueOf(pipeline.getId().getId()).toString()); assertCounter("NumReadStateMachineOps", 1L, metric); assertCounter("NumApplyTransactionOps", 1L, metric); } finally { diff --git a/hadoop-ozone/pom.xml b/hadoop-ozone/pom.xml index 2fcffab68cf..33af31b34d7 100644 --- a/hadoop-ozone/pom.xml +++ b/hadoop-ozone/pom.xml @@ -33,7 +33,7 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd"> 3.2.1-SNAPSHOT 0.4.0-SNAPSHOT 0.4.0-SNAPSHOT - 0.3.0-2272086-SNAPSHOT + 0.3.0-1d2ebee-SNAPSHOT 1.60 Badlands ${ozone.version} diff --git a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/scm/TestContainerSQLCli.java b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/scm/TestContainerSQLCli.java index 91178386bd0..054e6685fce 100644 --- a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/scm/TestContainerSQLCli.java +++ b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/scm/TestContainerSQLCli.java @@ -22,6 +22,7 @@ import org.apache.hadoop.hdds.scm.container.SCMContainerManager; import org.apache.hadoop.hdds.scm.events.SCMEvents; import org.apache.hadoop.hdds.scm.node.NodeManager; import org.apache.hadoop.hdds.scm.pipeline.PipelineManager; +import org.apache.hadoop.hdds.scm.pipeline.SCMPipelineManager; import org.apache.hadoop.hdds.server.events.EventQueue; import org.apache.hadoop.ozone.MiniOzoneCluster; import org.apache.hadoop.ozone.OzoneConfigKeys; @@ -122,7 +123,7 @@ public class TestContainerSQLCli { eventQueue = new EventQueue(); nodeManager = cluster.getStorageContainerManager().getScmNodeManager(); PipelineManager pipelineManager = - cluster.getStorageContainerManager().getPipelineManager(); + new SCMPipelineManager(conf, nodeManager, eventQueue); containerManager = new SCMContainerManager(conf, nodeManager, pipelineManager, eventQueue); blockManager = new BlockManagerImpl(