You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/07 03:51:17 UTC

[GitHub] [hadoop] xiaoyuyao commented on a change in pull request #1238: HDDS-1921. TestOzoneManagerDoubleBufferWithOMResponse is flaky

xiaoyuyao commented on a change in pull request #1238: HDDS-1921. TestOzoneManagerDoubleBufferWithOMResponse is flaky
URL: https://github.com/apache/hadoop/pull/1238#discussion_r311359109
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithOMResponse.java
 ##########
 @@ -345,21 +345,23 @@ public void testDoubleBuffer(int iterations, int bucketCount)
       }
 
       // 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);
 
 Review comment:
   The waitFor() moved above should have guarantee this condition already. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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