You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2020/05/07 16:18:42 UTC

[cassandra] branch cassandra-3.0 updated: Fix flaky test CustomIndexTest#indexBuildingPagesLargePartitions

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

adelapena pushed a commit to branch cassandra-3.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-3.0 by this push:
     new f858a80  Fix flaky test CustomIndexTest#indexBuildingPagesLargePartitions
f858a80 is described below

commit f858a800f05d33679b2bce2a08a701b5e61f36bc
Author: Andrés de la Peña <a....@gmail.com>
AuthorDate: Thu May 7 17:14:57 2020 +0100

    Fix flaky test CustomIndexTest#indexBuildingPagesLargePartitions
    
    patch by Andres de la Peña; reviewed by Berenguer Blasi for CASSANDRA-15757
---
 test/unit/org/apache/cassandra/index/CustomIndexTest.java | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/unit/org/apache/cassandra/index/CustomIndexTest.java b/test/unit/org/apache/cassandra/index/CustomIndexTest.java
index dcd6d34..1ab08fd 100644
--- a/test/unit/org/apache/cassandra/index/CustomIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/CustomIndexTest.java
@@ -684,7 +684,11 @@ public class CustomIndexTest extends CQLTester
         assertTrue(index.writeGroups.size() > 1);
         assertFalse(index.readOrderingAtFinish.isBlocking());
         index.writeGroups.forEach(group -> assertFalse(group.isBlocking()));
-        index.barriers.forEach(b -> assertTrue(b.getSyncPoint().isFinished()));
+        index.readBarriers.forEach(b -> assertTrue(b.getSyncPoint().isFinished()));
+        index.writeBarriers.forEach(b -> {
+            b.await(); // Keyspace.writeOrder is global, so this might be temporally blocked by other tests
+            assertTrue(b.getSyncPoint().isFinished());
+        });
     }
 
     @Test
@@ -1054,7 +1058,8 @@ public class CustomIndexTest extends CQLTester
         OpOrder.Group readOrderingAtStart = null;
         OpOrder.Group readOrderingAtFinish = null;
         Set<OpOrder.Group> writeGroups = new HashSet<>();
-        List<OpOrder.Barrier> barriers = new ArrayList<>();
+        List<OpOrder.Barrier> readBarriers = new ArrayList<>();
+        List<OpOrder.Barrier> writeBarriers = new ArrayList<>();
 
         static final int ROWS_IN_PARTITION = 1000;
 
@@ -1099,10 +1104,10 @@ public class CustomIndexTest extends CQLTester
                     // indexing of a partition
                     OpOrder.Barrier readBarrier = baseCfs.readOrdering.newBarrier();
                     readBarrier.issue();
-                    barriers.add(readBarrier);
+                    readBarriers.add(readBarrier);
                     OpOrder.Barrier writeBarrier = Keyspace.writeOrder.newBarrier();
                     writeBarrier.issue();
-                    barriers.add(writeBarrier);
+                    writeBarriers.add(writeBarrier);
                 }
 
                 public void insertRow(Row row)


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