cshannon commented on code in PR #4659: URL: https://github.com/apache/accumulo/pull/4659#discussion_r1639804458
########## 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: This interceptor is a neat way to test the different possibilities. The current code is fine so this could be a follow on or just done if we actually need it in the future, I am wondering if we should we make the probabilities configurable? I was thinking it could be useful to add another constructor with config parameters to define what percentage of time to pick each action. It could be useful if you want to more heavily test something, or even if you just wanted the interceptor to only perform one action 100% of the time. In some cases having things be more deterministic could be useful but that might also be better written as another interceptor if we want deterministic testing since the goal of the Flaky testing is to be random outcomes. -- 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