This is an automated email from the ASF dual-hosted git repository.
adoroszlai 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 31c2cfb0ab Revert "HDDS-10316. Speed up TestReconTasks (#6223)"
31c2cfb0ab is described below
commit 31c2cfb0ab4b6ae4474dca3d11be81c9fd5d0879
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sat Apr 6 13:48:36 2024 +0200
Revert "HDDS-10316. Speed up TestReconTasks (#6223)"
This reverts commit ccaaf571833a72cefec3c8b8169ceabbebc3652f.
Reason for revert: intermittent test failures (HDDS-10654)
---
.../apache/hadoop/ozone/recon/TestReconTasks.java | 37 +++++++---------------
1 file changed, 12 insertions(+), 25 deletions(-)
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
index 3d418459dc..cba7311b3b 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java
@@ -41,12 +41,8 @@ import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.LambdaTestUtils;
import org.hadoop.ozone.recon.schema.ContainerSchemaDefinition;
import org.hadoop.ozone.recon.schema.tables.pojos.UnhealthyContainers;
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
-import org.junit.jupiter.api.Order;
-import org.junit.jupiter.api.TestMethodOrder;
-import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;
import org.slf4j.event.Level;
@@ -62,14 +58,12 @@ import static
org.junit.jupiter.api.Assertions.assertNotEquals;
* Integration Tests for Recon's tasks.
*/
@Timeout(300)
-@TestInstance(TestInstance.Lifecycle.PER_CLASS)
-@TestMethodOrder(OrderAnnotation.class)
public class TestReconTasks {
private MiniOzoneCluster cluster = null;
private OzoneConfiguration conf;
- @BeforeAll
- void init() throws Exception {
+ @BeforeEach
+ public void init() throws Exception {
conf = new OzoneConfiguration();
conf.set(HDDS_CONTAINER_REPORT_INTERVAL, "5s");
conf.set(HDDS_PIPELINE_REPORT_INTERVAL, "5s");
@@ -80,22 +74,21 @@ public class TestReconTasks {
conf.set("ozone.scm.stale.node.interval", "6s");
conf.set("ozone.scm.dead.node.interval", "8s");
- cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(3)
+ cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(1)
.includeRecon(true).build();
cluster.waitForClusterToBeReady();
GenericTestUtils.setLogLevel(SCMDatanodeHeartbeatDispatcher.LOG,
Level.DEBUG);
}
- @AfterAll
- void shutdown() {
+ @AfterEach
+ public void shutdown() {
if (cluster != null) {
cluster.shutdown();
}
}
@Test
- @Order(3)
public void testSyncSCMContainerInfo() throws Exception {
ReconStorageContainerManagerFacade reconScm =
(ReconStorageContainerManagerFacade)
@@ -128,7 +121,6 @@ public class TestReconTasks {
}
@Test
- @Order(1)
public void testMissingContainerDownNode() throws Exception {
ReconStorageContainerManagerFacade reconScm =
(ReconStorageContainerManagerFacade)
@@ -149,7 +141,7 @@ public class TestReconTasks {
(ReconContainerManager) reconScm.getContainerManager();
ContainerInfo containerInfo =
scmContainerManager
- .allocateContainer(RatisReplicationConfig.getInstance(ONE),
"testMissingContainer");
+ .allocateContainer(RatisReplicationConfig.getInstance(ONE),
"test");
long containerID = containerInfo.getContainerID();
try (RDBBatchOperation rdbBatchOperation = new RDBBatchOperation()) {
@@ -189,8 +181,6 @@ public class TestReconTasks {
0, 1000);
return (allMissingContainers.isEmpty());
});
- // Cleaning up some data
- scmContainerManager.deleteContainer(containerInfo.containerID());
IOUtils.closeQuietly(client);
}
@@ -212,7 +202,6 @@ public class TestReconTasks {
* @throws Exception
*/
@Test
- @Order(2)
public void testEmptyMissingContainerDownNode() throws Exception {
ReconStorageContainerManagerFacade reconScm =
(ReconStorageContainerManagerFacade)
@@ -230,10 +219,9 @@ public class TestReconTasks {
ContainerManager scmContainerManager = scm.getContainerManager();
ReconContainerManager reconContainerManager =
(ReconContainerManager) reconScm.getContainerManager();
- int previousContainerCount = reconContainerManager.getContainers().size();
ContainerInfo containerInfo =
scmContainerManager
- .allocateContainer(RatisReplicationConfig.getInstance(ONE),
"testEmptyMissingContainer");
+ .allocateContainer(RatisReplicationConfig.getInstance(ONE),
"test");
long containerID = containerInfo.getContainerID();
Pipeline pipeline =
@@ -242,8 +230,8 @@ public class TestReconTasks {
runTestOzoneContainerViaDataNode(containerID, client);
// Make sure Recon got the container report with new container.
- assertEquals(scmContainerManager.getContainers().size(),
- reconContainerManager.getContainers().size() - previousContainerCount);
+ assertEquals(scmContainerManager.getContainers(),
+ reconContainerManager.getContainers());
// Bring down the Datanode that had the container replica.
cluster.shutdownHddsDatanode(pipeline.getFirstNode());
@@ -317,8 +305,7 @@ public class TestReconTasks {
0, 1000);
return (allMissingContainers.isEmpty());
});
- // Cleaning up some data
- reconContainerManager.deleteContainer(containerInfo.containerID());
+
IOUtils.closeQuietly(client);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]