You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by bh...@apache.org on 2019/08/07 04:14:50 UTC

[hadoop] branch trunk updated: HDDS-1921. TestOzoneManagerDoubleBufferWithOMResponse is flaky (#1238)

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

bharat pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9cd211a  HDDS-1921. TestOzoneManagerDoubleBufferWithOMResponse is flaky (#1238)
9cd211a is described below

commit 9cd211ac86bb1124bdee572fddb6f86655b19b73
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Wed Aug 7 06:14:41 2019 +0200

    HDDS-1921. TestOzoneManagerDoubleBufferWithOMResponse is flaky (#1238)
---
 ...TestOzoneManagerDoubleBufferWithOMResponse.java | 28 ++++++++++++----------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java
index 6a0bcb6..607f499 100644
--- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java
+++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java
@@ -64,9 +64,9 @@ public class TestOzoneManagerDoubleBufferWithOMResponse {
 
   private OMMetadataManager omMetadataManager;
   private OzoneManagerDoubleBuffer doubleBuffer;
-  private AtomicLong trxId = new AtomicLong(0);
+  private final AtomicLong trxId = new AtomicLong(0);
   private OzoneManagerRatisSnapshot ozoneManagerRatisSnapshot;
-  private long lastAppliedIndex;
+  private volatile long lastAppliedIndex;
 
   @Rule
   public TemporaryFolder folder = new TemporaryFolder();
@@ -345,21 +345,23 @@ public class TestOzoneManagerDoubleBufferWithOMResponse {
       }
 
       // We are doing +1 for volume transaction.
-      GenericTestUtils.waitFor(() ->
-              doubleBuffer.getFlushedTransactionCount() ==
-                  (bucketCount + 1) * iterations, 100,
-          120000);
+      long expectedTransactions = (bucketCount + 1) * iterations;
+      GenericTestUtils.waitFor(() -> lastAppliedIndex == expectedTransactions,
+          100, 120000);
 
-      Assert.assertTrue(omMetadataManager.countRowsInTable(
-          omMetadataManager.getVolumeTable()) == iterations);
+      Assert.assertEquals(expectedTransactions,
+          doubleBuffer.getFlushedTransactionCount()
+      );
 
-      Assert.assertTrue(omMetadataManager.countRowsInTable(
-          omMetadataManager.getBucketTable()) == (bucketCount) * iterations);
+      Assert.assertEquals(iterations,
+          omMetadataManager.countRowsInTable(omMetadataManager.getVolumeTable())
+      );
 
-      Assert.assertTrue(doubleBuffer.getFlushIterations() > 0);
+      Assert.assertEquals(bucketCount * iterations,
+          omMetadataManager.countRowsInTable(omMetadataManager.getBucketTable())
+      );
 
-      // Check lastAppliedIndex is updated correctly or not.
-      Assert.assertEquals((bucketCount + 1) * iterations, lastAppliedIndex);
+      Assert.assertTrue(doubleBuffer.getFlushIterations() > 0);
     } finally {
       stop();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org