This is an automated email from the ASF dual-hosted git repository.

sodonnel pushed a commit to branch HDDS-14496-zdu
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/HDDS-14496-zdu by this push:
     new 2f259232bd9 HDDS-16399. Fix flaky 
testFinalizationEmptyClusterDataDistribution (#11228)
2f259232bd9 is described below

commit 2f259232bd96d61866fc2c81de6482fe2c714d4e
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Fri Sep 11 11:14:06 2026 +0100

    HDDS-16399. Fix flaky testFinalizationEmptyClusterDataDistribution (#11228)
---
 .../upgrade/TestScmDataDistributionFinalization.java    | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestScmDataDistributionFinalization.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestScmDataDistributionFinalization.java
index 56b07e029db..502e6db3340 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestScmDataDistributionFinalization.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestScmDataDistributionFinalization.java
@@ -79,7 +79,6 @@
 import 
org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration;
 import org.apache.hadoop.ozone.container.upgrade.VersionedDatanodeFeatures;
 import org.apache.ozone.test.GenericTestUtils;
-import org.apache.ozone.test.tag.Flaky;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
 
@@ -161,7 +160,6 @@ public void shutdown() {
    * Test for an empty cluster.
    */
   @Test
-  @Flaky("HDDS-14050")
   public void testFinalizationEmptyClusterDataDistribution() throws Exception {
     init(new OzoneConfiguration());
     assertEquals(EMPTY_SUMMARY, 
cluster.getStorageContainerLocationClient().getDeletedBlockSummary());
@@ -190,6 +188,11 @@ public void testFinalizationEmptyClusterDataDistribution() 
throws Exception {
     StorageContainerManager activeSCM = cluster.getActiveSCM();
     assertEquals(-1, lastTxId, "Last transaction ID should be -1");
 
+    // Stop deleting service so it cannot race the summary assertions below.
+    for (StorageContainerManager scm : 
cluster.getStorageContainerManagersList()) {
+      scm.getScmBlockManager().getSCMBlockDeletingService().stop();
+    }
+
     // generate old format deletion tx, summary should keep empty, total DB tx 
4
     int txCount = 4;
     DeletedBlockLogImpl deletedBlockLog = (DeletedBlockLogImpl) 
activeSCM.getScmBlockManager().getDeletedBlockLog();
@@ -217,6 +220,11 @@ public void testFinalizationEmptyClusterDataDistribution() 
throws Exception {
     assertEquals(txCount * BLOCKS_PER_TX * BLOCK_SIZE, 
summary.getTotalBlockSize());
     assertEquals(txCount * BLOCKS_PER_TX * BLOCK_SIZE * 3, 
summary.getTotalBlockReplicatedSize());
 
+    // Restart deleting service so transactions are drained below.
+    for (StorageContainerManager scm : 
cluster.getStorageContainerManagersList()) {
+      scm.getScmBlockManager().getSCMBlockDeletingService().start();
+    }
+
     // wait for all transactions deleted by SCMBlockDeletingService
     GenericTestUtils.waitFor(() -> {
       try {
@@ -228,6 +236,11 @@ public void testFinalizationEmptyClusterDataDistribution() 
throws Exception {
       }
     }, 100, 5000);
 
+    // Stop deleting service again to prevent it from racing the summary 
assertions below.
+    for (StorageContainerManager scm : 
cluster.getStorageContainerManagersList()) {
+      scm.getScmBlockManager().getSCMBlockDeletingService().stop();
+    }
+
     // generate old format deletion tx, summary should keep the same
     deletedBlockLog.addTransactions(generateDeletedBlocks(txCount, false));
     flushDBTransactionBuffer(activeSCM);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to