You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/04/21 06:43:15 UTC

[GitHub] [cassandra] bereng opened a new pull request #975: CASSANDRA-16601 Flaky CassandraIndexTest

bereng opened a new pull request #975:
URL: https://github.com/apache/cassandra/pull/975


   


-- 
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



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


[GitHub] [cassandra] bereng commented on pull request #975: CASSANDRA-16601 Flaky CassandraIndexTest

Posted by GitBox <gi...@apache.org>.
bereng commented on pull request #975:
URL: https://github.com/apache/cassandra/pull/975#issuecomment-824552470


   CI [here](https://app.circleci.com/pipelines/github/bereng/cassandra/260/workflows/b35ae7c1-a080-495f-bf2b-c486ae1ee842)


-- 
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



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


[GitHub] [cassandra] bereng commented on a change in pull request #975: CASSANDRA-16601 Flaky CassandraIndexTest

Posted by GitBox <gi...@apache.org>.
bereng commented on a change in pull request #975:
URL: https://github.com/apache/cassandra/pull/975#discussion_r617459746



##########
File path: test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
##########
@@ -570,33 +570,39 @@ public void indexCorrectlyMarkedAsBuildAndRemoved() throws Throwable
         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.
+        Util.spinAssertEquals(0, () -> {
+            try
+            {
+                return execute(selectBuiltIndexesQuery).size();
+            }
+            catch(Throwable e)
+            {
+                fail(e.getMessage());
+            }
+            return -1;

Review comment:
       I'll be happy to take these and I'll commit.




-- 
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



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


[GitHub] [cassandra] bereng closed pull request #975: CASSANDRA-16601 Flaky CassandraIndexTest

Posted by GitBox <gi...@apache.org>.
bereng closed pull request #975:
URL: https://github.com/apache/cassandra/pull/975


   


-- 
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



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


[GitHub] [cassandra] adelapena commented on a change in pull request #975: CASSANDRA-16601 Flaky CassandraIndexTest

Posted by GitBox <gi...@apache.org>.
adelapena commented on a change in pull request #975:
URL: https://github.com/apache/cassandra/pull/975#discussion_r617441332



##########
File path: test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
##########
@@ -570,33 +570,39 @@ public void indexCorrectlyMarkedAsBuildAndRemoved() throws Throwable
         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.
+        Util.spinAssertEquals(0, () -> {
+            try
+            {
+                return execute(selectBuiltIndexesQuery).size();
+            }
+            catch(Throwable e)
+            {
+                fail(e.getMessage());
+            }
+            return -1;

Review comment:
       Nit: I think that `return -1;` will never be reached, it probably can be slightly simplified by just directly throwing an assertion error:
   ```suggestion
                   throw new AssertionError(e);
               }
   ```

##########
File path: test/unit/org/apache/cassandra/index/internal/CassandraIndexTest.java
##########
@@ -570,33 +570,39 @@ public void indexCorrectlyMarkedAsBuildAndRemoved() throws Throwable
         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.
+        Util.spinAssertEquals(0, () -> {
+            try
+            {
+                return execute(selectBuiltIndexesQuery).size();
+            }
+            catch(Throwable e)

Review comment:
       Super nit: missed whitespace
   ```suggestion
               catch (Throwable e)
   ```




-- 
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



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