jacek-lewandowski commented on code in PR #2713:
URL: https://github.com/apache/cassandra/pull/2713#discussion_r1339589770


##########
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:
   Though, this is not a dtest and there is no networking. Repeated run with 
this test already completed without problems. If you insist, I can change that, 
however, I cannot justify such a long timeout given what it waits for. 



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