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

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

commit 9ad849337063b79308dddc05c2798794354ea035
Merge: 5875cbe839 943184b194
Author: Jon Meredith <jonmered...@apache.org>
AuthorDate: Mon Jun 6 11:07:14 2022 -0600

    Merge branch 'cassandra-4.0' into cassandra-4.1

 .../distributed/test/MessageForwardingTest.java       | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --cc 
test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
index c179737e37,f7883b38a1..a4dd8e6442
--- 
a/test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
@@@ -23,7 -23,11 +23,10 @@@ import java.net.InetAddress
  import java.util.HashMap;
  import java.util.List;
  import java.util.Map;
 -import java.util.UUID;
+ import java.util.concurrent.ExecutionException;
  import java.util.concurrent.Future;
+ import java.util.concurrent.TimeUnit;
+ import java.util.concurrent.TimeoutException;
  import java.util.stream.Collectors;
  import java.util.stream.IntStream;
  import java.util.stream.Stream;
@@@ -69,9 -72,24 +73,24 @@@ public class MessageForwardingTest exte
              //noinspection ResultOfMethodCallIgnored
              
inserts.map(IsolatedExecutor::waitOn).collect(Collectors.toList());
  
+             // Tracing is async with respect to queries, just because the 
query has completed it does not mean
+             // all tracing updates have completed. The tracing executor 
serializes work, so run a task through
+             // and everthing submitted before must have completed.
+             cluster.forEach(instance -> instance.runOnInstance(() -> {
+                 Future<?> result = Stage.TRACING.submit(() -> null);
+                 try
+                 {
+                     result.get(30, TimeUnit.SECONDS);
+                 }
+                 catch (ExecutionException | InterruptedException | 
TimeoutException ex)
+                 {
+                     throw new RuntimeException(ex);
+                 }
+             }));
+ 
              cluster.stream("dc1").forEach(instance -> 
forwardFromCounts.put(instance.broadcastAddress().getAddress(), 0));
              cluster.forEach(instance -> 
commitCounts.put(instance.broadcastAddress().getAddress(), 0));
 -            List<TracingUtil.TraceEntry> traces = 
TracingUtil.getTrace(cluster, sessionId, ConsistencyLevel.ALL);
 +            List<TracingUtil.TraceEntry> traces = 
TracingUtil.getTrace(cluster, sessionId.asUUID(), ConsistencyLevel.ALL);
              traces.forEach(traceEntry -> {
                  if (traceEntry.activity.contains("Appending to commitlog"))
                  {


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

Reply via email to