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 4a85b7354e7 HDDS-16283. Fix flaky 
testMoveToTrashAbortTaskWhenTrashRootPrepareFails (#11109)
4a85b7354e7 is described below

commit 4a85b7354e779c6bc3838d4bd1ddd7747f3ed920
Author: Aryan Gupta <[email protected]>
AuthorDate: Wed Aug 26 12:36:27 2026 +0530

    HDDS-16283. Fix flaky testMoveToTrashAbortTaskWhenTrashRootPrepareFails 
(#11109)
---
 .../apache/hadoop/ozone/om/service/TestKeyLifecycleService.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java
 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java
index ccc3275af87..5f41fb37d75 100644
--- 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java
+++ 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java
@@ -2689,9 +2689,10 @@ void testMoveToTrashAbortTaskWhenTrashRootPrepareFails() 
throws Exception {
       final String keyPrefix = "key";
       String bucketOwner = 
UserGroupInformation.getCurrentUser().getShortUserName() + "-test";
       long initialKeyCount = getKeyCount(FILE_SYSTEM_OPTIMIZED);
-      long initialSuccessTaskCount = metrics.getNumSuccessTask().value();
 
-      createKeys(volumeName, bucketName, FILE_SYSTEM_OPTIMIZED, bucketOwner, 
1, 1, keyPrefix, null);
+      List<OmKeyArgs> createdKeys =
+          createKeys(volumeName, bucketName, FILE_SYSTEM_OPTIMIZED, 
bucketOwner, 1, 1, keyPrefix, null);
+      assertEquals(1, createdKeys.size());
       Thread.sleep(SERVICE_INTERVAL);
       GenericTestUtils.waitFor(() -> getKeyCount(FILE_SYSTEM_OPTIMIZED) - 
initialKeyCount == 1,
           WAIT_CHECK_INTERVAL, 1000);
@@ -2740,7 +2741,8 @@ void testMoveToTrashAbortTaskWhenTrashRootPrepareFails() 
throws Exception {
 
         assertTrue(log.getOutput().contains("Failed to prepare trash root"));
         assertTrue(log.getOutput().contains("Failed to evaluate lifecycle 
configuration for bucket"));
-        assertEquals(initialSuccessTaskCount, 
metrics.getNumSuccessTask().value());
+        // Verify local bucket state instead of global lifecycle metrics, 
which are shared across parameterized runs.
+        assertNotNull(writeClient.getKeyInfo(createdKeys.get(0), false));
         assertEquals(1, getKeyCount(FILE_SYSTEM_OPTIMIZED) - initialKeyCount);
       } finally {
         ozoneManagerField.set(keyLifecycleService, om);


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

Reply via email to