You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by be...@apache.org on 2021/04/22 06:02:00 UTC

[cassandra] branch trunk updated (6564fe3 -> b2e897f)

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

bereng pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


    from 6564fe3  Merge branch 'cassandra-3.11' into trunk
     new 4bfe687  Flaky CassandraIndexTest
     new d273ecf  Merge branch 'cassandra-3.11' into trunk
     new b2e897f  CASSANDRA-16601 Flaky CassandraIndexTest

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../index/internal/CassandraIndexTest.java         | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

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


[cassandra] 01/02: Merge branch 'cassandra-3.11' into trunk

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d273ecf9f2fc2387330cdc130323520d562e2fed
Merge: 6564fe3 4bfe687
Author: Bereng <be...@gmail.com>
AuthorDate: Thu Apr 22 07:53:06 2021 +0200

    Merge branch 'cassandra-3.11' into trunk


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


[cassandra] 02/02: CASSANDRA-16601 Flaky CassandraIndexTest

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit b2e897f6a92b931f6f8595a2c0c8d12b04aaf601
Author: Bereng <be...@gmail.com>
AuthorDate: Wed Apr 14 11:15:25 2021 +0200

    CASSANDRA-16601 Flaky CassandraIndexTest
    
    patch by Berenguer Blasi; reviewed by Andrés de la Peña for CASSANDRA-16601
---
 .../index/internal/CassandraIndexTest.java         | 25 +++++++++++-----------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
index 687c631..2c46bdb 100644
--- a/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
@@ -18,6 +18,7 @@
 
 package org.apache.cassandra.index.internal;
 
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
@@ -42,6 +43,7 @@ import org.apache.cassandra.schema.SchemaConstants;
 import org.apache.cassandra.schema.TableMetadata;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
+import org.awaitility.Awaitility;
 
 import static org.apache.cassandra.Util.throwAssert;
 import static org.junit.Assert.assertArrayEquals;
@@ -561,33 +563,32 @@ public class CassandraIndexTest extends CQLTester
         String selectBuiltIndexesQuery = String.format("SELECT * FROM %s.\"%s\"",
                                                        SchemaConstants.SYSTEM_KEYSPACE_NAME,
                                                        SystemKeyspace.BUILT_INDEXES);
-        UntypedResultSet rs = execute(selectBuiltIndexesQuery);
-        int initialSize = rs.size();
+
+        // Wait for any background index clearing tasks to complete. Warn: When we used to run tests in parallel there
+        // could also be cross test class talk and have other indices pop up here.
+        Awaitility.await()
+                  .atMost(1, TimeUnit.MINUTES)
+                  .pollDelay(1, TimeUnit.SECONDS)
+                  .untilAsserted(() -> assertRows(execute(selectBuiltIndexesQuery)));
 
         String indexName = "build_remove_test_idx";
         String tableName = createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b))");
         createIndex(String.format("CREATE INDEX %s ON %%s(c)", indexName));
         waitForIndex(KEYSPACE, tableName, indexName);
+
         // check that there are no other rows in the built indexes table
-        rs = execute(selectBuiltIndexesQuery);
-        int sizeAfterBuild = rs.size();
-        assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName, null));
+        assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName, null));
 
         // rebuild the index and verify the built status table
         getCurrentColumnFamilyStore().rebuildSecondaryIndex(indexName);
         waitForIndex(KEYSPACE, tableName, indexName);
 
         // check that there are no other rows in the built indexes table
-        rs = execute(selectBuiltIndexesQuery);
-        assertEquals(sizeAfterBuild, rs.size());
-        assertRowsIgnoringOrderAndExtra(rs, row(KEYSPACE, indexName, null));
+        assertRows(execute(selectBuiltIndexesQuery), row(KEYSPACE, indexName, null));
 
         // check that dropping the index removes it from the built indexes table
         dropIndex("DROP INDEX %s." + indexName);
-        rs = execute(selectBuiltIndexesQuery);
-        assertEquals(initialSize, rs.size());
-        rs.forEach(row -> assertFalse(row.getString("table_name").equals(KEYSPACE)  // table_name is actually keyspace
-                                      && row.getString("index_name").equals(indexName)));
+        assertRows(execute(selectBuiltIndexesQuery));
     }
 
 

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