bereng commented on code in PR #2713:
URL: https://github.com/apache/cassandra/pull/2713#discussion_r1339951467


##########
test/unit/org/apache/cassandra/cql3/statements/DescribeStatementTest.java:
##########
@@ -377,6 +393,52 @@ public void testDescribe() throws Throwable
         }
     }
 
+    private static volatile CountDownLatch describeStatementLatch;
+    public static void awaitDescribeStatementLatch()
+    {
+        if (Arrays.stream(Thread.currentThread().getStackTrace()).anyMatch(ste 
-> ste.getClassName().equals(DescribeStatement.class.getName())))
+        {
+            describeStatementLatch.decrement();
+            describeStatementLatch.awaitThrowUncheckedOnInterrupt();
+        }
+    }
+
+    @Test
+    @BMRule(name = "blablabla",
+            targetClass = "Schema",
+            targetMethod = "distributedAndLocalKeyspaces",
+            targetLocation = "AT ENTRY",
+            action = 
"org.apache.cassandra.cql3.statements.DescribeStatementTest.awaitDescribeStatementLatch()")
+    public void testNotReturningPartiallyAppliedSchema() throws Throwable
+    {
+        describeStatementLatch = CountDownLatch.newCountDownLatch(2);
+        ForkJoinTask<ResultSet> describeFuture = 
ForkJoinPool.commonPool().submit(() -> {
+            try
+            {
+                return executeNetWithPaging(ProtocolVersion.CURRENT, "DESCRIBE 
KEYSPACES", 1);
+            }
+            catch (Throwable e)
+            {
+                throw new RuntimeException(e);
+            }
+        });
+        // wait for the describe statement to be in progress
+        Awaitility.await().atMost(Duration.ofSeconds(5)).until(() -> 
describeStatementLatch.count() == 1);

Review Comment:
   It does indeed make a lot of sense to raise it. The pain of having to 
continuously debug flakies, read the logs, chase the code, etc. which in the 
end happen to be just timeouts it's not negligible and very demotivating imo.
   
   20s sounds like a magic number. You mentioned `test.driver.read_timeout_ms` 
is at 24s. I wonder if we can access that programmatically?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to