belliottsmith commented on code in PR #106: URL: https://github.com/apache/cassandra-accord/pull/106#discussion_r1702356828
########## accord-core/src/test/java/accord/local/cfk/CommandsForKeyTest.java: ########## @@ -0,0 +1,1081 @@ +/* + * 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 accord.local.cfk; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.concurrent.Callable; +import java.util.function.Consumer; +import java.util.function.Function; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import org.junit.jupiter.api.Test; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import accord.api.Agent; +import accord.api.Data; +import accord.api.DataStore; +import accord.api.Key; +import accord.api.ProgressLog; +import accord.api.Query; +import accord.api.Read; +import accord.api.Result; +import accord.api.RoutingKey; +import accord.api.Update; +import accord.impl.IntKey; +import accord.local.Command; +import accord.local.Command.AbstractCommand; +import accord.local.CommandStore; +import accord.local.CommandStores; +import accord.local.CommonAttributes; +import accord.local.Listeners; +import accord.local.Node; +import accord.local.NodeTimeService; +import accord.local.PreLoadContext; +import accord.local.SafeCommand; +import accord.local.SafeCommandStore; +import accord.local.SaveStatus; +import accord.local.Status; +import accord.local.cfk.CommandsForKey.TxnInfo; +import accord.primitives.Ballot; +import accord.primitives.Deps; +import accord.primitives.EpochSupplier; +import accord.primitives.FullRoute; +import accord.primitives.Keys; +import accord.primitives.Participants; +import accord.primitives.Range; +import accord.primitives.Ranges; +import accord.primitives.Routable.Domain; +import accord.primitives.Route; +import accord.primitives.Seekable; +import accord.primitives.Seekables; +import accord.primitives.Timestamp; +import accord.primitives.Txn; +import accord.primitives.TxnId; +import accord.primitives.Unseekables; +import accord.primitives.Writes; +import accord.utils.DefaultRandom; +import accord.utils.Invariants; +import accord.utils.RandomSource; +import accord.utils.async.AsyncChain; +import accord.utils.async.AsyncResults; + +import static accord.local.Command.NotDefined.notDefined; +import static accord.local.Status.Durability.NotDurable; + +// TODO (expected): test setting redundant before +// TODO (expected): test ballot updates +// TODO (expected): test transition to Erased +// TODO (expected): ensure execution is not too early +// TODO (expected): validate mapReduce +// TODO (expected): insert linearizability violations and detect them +public class CommandsForKeyTest Review Comment: We do validate quite a lot actually, though most of it depends on `checkIntegrity` in CFK, which requires command line parameters to be specified. We also verify that all of the transactions execute. What we don't currently check is that they don't execute too early, so I think this particular corruption would go undetected anyway - since an almost empty CFK is perfectly valid in itself. -- 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]

