maedhroz commented on code in PR #3060:
URL: https://github.com/apache/cassandra/pull/3060#discussion_r1497949880


##########
test/distributed/org/apache/cassandra/fuzz/harry/integration/dsl/HistoryBuilderIntegrationTest.java:
##########
@@ -129,16 +104,88 @@ public void simpleDSLTest() throws Throwable
                                 return false;
 
                             HistoryBuilder historyBuilder = (HistoryBuilder) 
history;
-                            ReplayingVisitor visitor = 
historyBuilder.visitor(run.tracker, run.sut, 
SystemUnderTest.ConsistencyLevel.ALL);
+                            ReplayingVisitor visitor = 
historyBuilder.visitor(tracker, sut, SystemUnderTest.ConsistencyLevel.ALL);
+                            visitor.replayAll();
+
+                            if (historyBuilder.visitedPds().size() < 
MAX_PARTITIONS)
+                                return false;
+
+                            Model model = 
historyBuilder.quiescentChecker(tracker, sut);
+
+                            for (Long pd : historyBuilder.visitedPds())
+                                
model.validate(Query.selectPartition(historyBuilder.schema(), pd,false));
+
+                            return true;
+                        })
+                        .run(STEPS_PER_ITERATION, seed);
+        }
+    }
+
+    @Test
+    public void overrideCkTest() throws Throwable
+    {
+        Supplier<SchemaSpec> supplier = 
SchemaGenerators.progression(SchemaGenerators.DEFAULT_SWITCH_AFTER);
+        for (int schemaIdx = 0; schemaIdx < SchemaGenerators.DEFAULT_RUNS; 
schemaIdx++)
+        {
+            SchemaSpec schema = supplier.get();
+            DataTracker tracker = new DefaultDataTracker();
+            beforeEach();
+            sut.schemaChange(schema.compile().cql());
+
+            ModelChecker<HistoryBuilder> modelChecker = new ModelChecker<>();
+            JdkRandomEntropySource rng = new JdkRandomEntropySource(new 
Random(seed));
+
+            TokenPlacementModel.ReplicationFactor rf = new 
TokenPlacementModel.SimpleReplicationFactor(1);
+
+            int maxPartitionSize = 10;
+            modelChecker.init(new HistoryBuilder(seed, maxPartitionSize, 10, 
schema, rf))
+                        .beforeAll((history) -> {
+                            for (int i = 0; i < MAX_PARTITIONS; i++)
+                                
history.forPartition(i).ensureClustering(schema.ckGenerator.inflate(rng.nextLong()));

Review Comment:
   So this is the crux of the test? i.e. Make sure every partition has the 
provided clustering key inflated from the underlying `KeyPartOverride`, then do 
normal validation?



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