ctubbsii commented on code in PR #4659:
URL: https://github.com/apache/accumulo/pull/4659#discussion_r1640010444


##########
test/src/main/java/org/apache/accumulo/test/ample/FlakyInterceptor.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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
+ *
+ *   https://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.accumulo.test.ample;
+
+import static org.apache.accumulo.core.client.ConditionalWriter.Status.UNKNOWN;
+import static org.apache.accumulo.core.util.LazySingletons.RANDOM;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.accumulo.core.client.ConditionalWriter;
+import org.apache.accumulo.core.data.ConditionalMutation;
+import org.apache.accumulo.test.ample.metadata.ConditionalWriterInterceptor;
+import org.apache.hadoop.io.Text;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class FlakyInterceptor implements ConditionalWriterInterceptor {

Review Comment:
   The two different modes that you're talking about are typically covered by a 
different test suite. Random behavioral tests have historically been covered by 
something like RandomWalk or ContinuousIngest, which moved to the 
accumulo-testing repository.
   
   I don't think our integration tests should engage in behavior that results 
in a random outcome. If there's a random element in the test to cover an edge 
case, then the test itself should be written such that the edge case is 
guaranteed, or nearly guaranteed, to have coverage every time.
   
   Example:
   
   ```java
   @Test
   public void randomTestBad() {
     coverEdgeCase20PercentOfTheTime();
   }
   
   @Test
   public void randomTestBetter() {
     for (int x = 1; x < 100; x++) {
       coverEdgeCase20PercentOfTheTime();
     }
   }
   ```
   
   We can make the Maven build much more complex by having separate executions 
of different classes of tests, but I would recommend against doing that, 
because it can get way too complicated way too fast, and I think what we should 
be doing is writing more resilient ITs that have more comprehensive coverage of 
these edge cases.



-- 
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: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to