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

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

commit 943184b1948c57fcfecdcd968bab02e2fca2ea56
Merge: 52f6ac4af9 c9a7269874
Author: Jon Meredith <jonmered...@apache.org>
AuthorDate: Mon Jun 6 11:05:59 2022 -0600

    Merge branch 'cassandra-3.11' into cassandra-4.0

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

diff --cc 
test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
index 153d7de706,895772364c..f7883b38a1
--- 
a/test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/test/MessageForwardingTest.java
@@@ -24,16 -24,20 +24,20 @@@ 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;
  
  import org.junit.Assert;
  import org.junit.Test;
  
+ import org.apache.cassandra.concurrent.Stage;
 -import org.apache.cassandra.concurrent.StageManager;
 -import org.apache.cassandra.distributed.Cluster;
  import org.apache.cassandra.distributed.api.ConsistencyLevel;
 +import org.apache.cassandra.distributed.Cluster;
  import org.apache.cassandra.distributed.impl.IsolatedExecutor;
  import org.apache.cassandra.distributed.impl.TracingUtil;
  import org.apache.cassandra.utils.UUIDGen;
@@@ -66,9 -69,23 +70,24 @@@ public class MessageForwardingTest exte
              // Wait for each of the futures to complete before checking the 
traces, don't care
              // about the result so
              //noinspection ResultOfMethodCallIgnored
 -            inserts.map(IsolatedExecutor::waitOn).count();
 +            
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 = 
StageManager.getStage(Stage.TRACING).submit(() -> null);
++                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);
              traces.forEach(traceEntry -> {


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

Reply via email to