dcapwell commented on code in PR #3789:
URL: https://github.com/apache/cassandra/pull/3789#discussion_r1918901210


##########
test/distributed/org/apache/cassandra/distributed/upgrade/ClusterMetadataUpgradeHarryTest.java:
##########
@@ -18,115 +18,135 @@
 
 package org.apache.cassandra.distributed.upgrade;
 
-import java.util.Collections;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
+import java.time.Duration;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
-import com.google.common.util.concurrent.Uninterruptibles;
-
-import org.apache.cassandra.harry.HarryHelper;
-import org.apache.cassandra.harry.core.Configuration;
-import org.apache.cassandra.harry.ddl.SchemaSpec;
-
-import org.apache.cassandra.harry.runner.FlaggedRunner;
-import org.apache.cassandra.harry.sut.injvm.ClusterState;
-import org.apache.cassandra.harry.sut.injvm.ExistingClusterSUT;
-
-import org.apache.cassandra.harry.visitors.MutatingVisitor;
-import org.apache.cassandra.harry.visitors.QueryLogger;
-import org.apache.cassandra.harry.visitors.RandomPartitionValidator;
-
 import org.junit.Test;
 
+import org.apache.cassandra.concurrent.Interruptible;
 import org.apache.cassandra.distributed.Constants;
+import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.Feature;
+import org.apache.cassandra.harry.SchemaSpec;
+import org.apache.cassandra.harry.dsl.HistoryBuilder;
+import org.apache.cassandra.harry.dsl.ReplayingHistoryBuilder;
+import org.apache.cassandra.harry.execution.InJvmDTestVisitExecutor;
+import org.apache.cassandra.harry.gen.Generator;
+import org.apache.cassandra.harry.gen.Generators;
 import org.apache.cassandra.schema.SchemaConstants;
-import org.apache.cassandra.utils.concurrent.CountDownLatch;
-
+import org.apache.cassandra.utils.concurrent.UncheckedInterruptedException;
 
 import static java.util.Arrays.asList;
 import static 
org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory;
-import static 
org.apache.cassandra.harry.core.Configuration.VisitorPoolConfiguration.pool;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.asciiType;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.int64Type;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.ck;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.pk;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.regularColumn;
-import static org.apache.cassandra.harry.ddl.ColumnSpec.staticColumn;
+import static 
org.apache.cassandra.concurrent.InfiniteLoopExecutor.SimulatorSafe.UNSAFE;
+import static org.apache.cassandra.harry.ColumnSpec.asciiType;
+import static org.apache.cassandra.harry.ColumnSpec.ck;
+import static org.apache.cassandra.harry.ColumnSpec.int64Type;
+import static org.apache.cassandra.harry.ColumnSpec.pk;
+import static org.apache.cassandra.harry.ColumnSpec.regularColumn;
+import static org.apache.cassandra.harry.ColumnSpec.staticColumn;
+import static org.apache.cassandra.harry.checker.TestHelper.withRandom;
 import static org.apache.cassandra.tcm.log.SystemKeyspaceStorage.NAME;
 import static org.junit.Assert.assertEquals;
 
 public class ClusterMetadataUpgradeHarryTest extends UpgradeTestBase
 {
     @Test
-    public void simpleUpgradeTest() throws Throwable
+    public void simpleUpgradeTest()
     {
-        ExecutorService es = executorFactory().pooled("harry", 1);
+        AtomicReference<Interruptible> executor = new AtomicReference<>();
+        AtomicLong loops = new AtomicLong(0);
         Listener listener = new Listener();
-        CountDownLatch stopLatch = CountDownLatch.newCountDownLatch(1);
-        AtomicReference<Future<?>> harryRunner = new AtomicReference<>();
-        new UpgradeTestBase.TestCase()
-        .nodes(3)
-        .nodesToUpgrade(1, 2, 3)
-        .withConfig((cfg) -> cfg.with(Feature.NETWORK, Feature.GOSSIP)
-                                .set(Constants.KEY_DTEST_FULL_STARTUP, true))
-        .upgradesToCurrentFrom(v41)
-        .withUpgradeListener(listener)
-        .setup((cluster) -> {
-             SchemaSpec schema = new SchemaSpec("harry", "test_table",
-                                                asList(pk("pk1", asciiType), 
pk("pk2", int64Type)),
-                                                asList(ck("ck1", asciiType), 
ck("ck2", int64Type)),
-                                                
asList(regularColumn("regular1", asciiType), regularColumn("regular2", 
int64Type)),
-                                                asList(staticColumn("static1", 
asciiType), staticColumn("static2", int64Type)));
-
-            Configuration config = HarryHelper.defaultConfiguration()
-                                              
.setKeyspaceDdl(String.format("CREATE KEYSPACE IF NOT EXISTS %s WITH 
replication = {'class': 'SimpleStrategy', 'replication_factor': %d};", 
schema.keyspace, 3))
-                                              .setSchemaProvider(new 
Configuration.FixedSchemaProviderConfiguration(schema))
-                                              .setDataTracker(new 
Configuration.LockingDataTrackerConfiguration(-1l, -1l, 
Collections.emptyList()))
-                                              .setSUT(new 
ExistingClusterSUT(cluster, listener))
-                                              .build();
-
-            Future<?> f = es.submit(() -> {
+        Runnable awaitHarryProgress = () -> {
+            long startingLoopCount = loops.get();
+            long deadline = startingLoopCount + 10;

Review Comment:
   can we make this 100 to match cep-15-accord?



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