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


##########
test/distributed/org/apache/cassandra/distributed/test/simulator/AccordSimulationTest.java:
##########
@@ -0,0 +1,109 @@
+/*
+ * 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.distributed.test.simulator;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import com.google.common.base.StandardSystemProperty;
+import org.junit.Test;
+
+//REIVEW: totally fine dropping this as it is a dupe of 
org.apache.cassandra.simulator.test.ShortAccordSimulationTest
+// the goal of this test was being able to run in intellij.  This also has the 
side benefit that "ant testclasslist" can
+// run this test; which gives us parallel execution for free!
+public class AccordSimulationTest
+
+{
+    private static String getSeed()
+    {
+        String value = System.getProperty("cassandra.test.simulation.seed");
+        if (value != null)
+            return value;
+        long seed = System.currentTimeMillis();
+        return "0x" + Long.toHexString(seed);
+    }
+
+    @Test
+    public void test() throws IOException, InterruptedException, 
TimeoutException
+    {
+        String seedString = getSeed();
+
+        String classpath = StandardSystemProperty.JAVA_CLASS_PATH.value();
+        File exec = new File(StandardSystemProperty.JAVA_HOME.value(), 
"bin/java");
+
+        List<String> args = new ArrayList<>();
+        args.add(exec.getAbsolutePath());
+        args.addAll(setupJVM());
+        
args.add("org.apache.cassandra.simulator.paxos.AccordSimulationRunner");
+        args.addAll(Arrays.asList("run",
+                                  "--seed", seedString,
+                                  "-n", "3..6",
+                                  "-t", "1000",
+                                  "--cluster-action-limit", "-1",
+                                  "-c", "2",
+                                  "-s", "30"));
+        ProcessBuilder pb = new ProcessBuilder();
+        pb.environment().put("CLASSPATH", classpath);
+        pb.command(args);
+        Process p = pb.inheritIO().start();
+        boolean completed = p.waitFor(5, TimeUnit.MINUTES);
+        if (!completed)
+            throw new TimeoutException("Timeout waiting on simulation");
+        int rc = p.waitFor();
+        if (rc != 0)

Review Comment:
   heh, without the logs the CI output looks lame
   
   
https://app.circleci.com/pipelines/github/dcapwell/cassandra/1665/workflows/65e737da-5269-40c5-a504-5bbd2701c6f1/jobs/13785



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