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


##########
test/distributed/org/apache/cassandra/fuzz/sai/MultiNodeSAITestBase.java:
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.fuzz.sai;
+
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+import org.apache.cassandra.distributed.Cluster;
+import org.apache.cassandra.distributed.test.sai.SAIUtil;
+import org.apache.cassandra.harry.ddl.SchemaSpec;
+import org.apache.cassandra.harry.sut.injvm.InJvmSut;
+import org.apache.cassandra.harry.sut.injvm.InJvmSutBase;
+
+import static org.apache.cassandra.distributed.api.Feature.GOSSIP;
+import static org.apache.cassandra.distributed.api.Feature.NETWORK;
+
+public abstract class MultiNodeSAITestBase extends SingleNodeSAITestBase
+{
+    /**
+     * Chosing a fetch size has implications for how well this test will 
excercise paging, short-read protection, and
+     * other important parts of the distributed query apparatus. This should 
be set low enough to ensure a significant
+     * number of queries during validation page, but not too low that more 
expesive queries time out and fail the test.
+     */
+    private static final int FETCH_SIZE = 10;
+
+    public MultiNodeSAITestBase(boolean withAccord)
+    {
+        super(withAccord);
+    }
+
+    @BeforeClass
+    public static void before() throws Throwable
+    {
+        before(false);
+    }
+
+    public static void before(boolean withAccord) throws Throwable
+    {
+        cluster = Cluster.build()
+                         .withNodes(2)
+                         // At lower fetch sizes, queries w/ hundreds or 
thousands of matches can take a very long time. 
+                         .withConfig(InJvmSutBase.defaultConfig().andThen(c -> 
c.set("range_request_timeout", "180s")
+                                                                               
 .set("read_request_timeout", "180s")
+                                                                               
 .set("transaction_timeout", "180s")
+                                                                               
 .set("write_request_timeout", "180s")
+                                                                               
 .set("native_transport_timeout", "180s")
+                                                                               
 .set("slow_query_log_timeout", "180s")
+                                                                               
 .with(GOSSIP).with(NETWORK)))
+                         .createWithoutStarting();
+        cluster.setUncaughtExceptionsFilter(t -> {
+            logger.error("Caught exception, reporting during shutdown. 
Ignoring.", t);
+            return true;
+        });
+        cluster.startup();
+        cluster = init(cluster);
+        sut = new InJvmSut(cluster) {
+            @Override
+            public Object[][] execute(String cql, ConsistencyLevel cl, 
Object[] bindings)
+            {
+                // The goal here is to make replicas as out of date as 
possible, modulo the efforts of repair
+                // and read-repair in the test itself.

Review Comment:
   nit: The spirit of the original comment here was explaining why we write at 
NODE_LOCAL for the non-Accord case. I'd consider moving it down/merging w/ your 
other comment to clarify the intent of Accord (actually test Accord) and 
non-Accord (make data pathologically mismatched across nodes) test modes.



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