cockroach: Index | Files

package tests

import ""


Package Files

command_filters.go data.go end_txn_trigger.go server_params.go

func CheckEndTxnTrigger Uses

func CheckEndTxnTrigger(args kvserverbase.FilterArgs) *roachpb.Error

CheckEndTxnTrigger verifies that an EndTxnRequest that includes intents for the SystemDB keys sets the proper trigger.

func CheckKeyCount Uses

func CheckKeyCount(t *testing.T, kvDB *kv.DB, span roachpb.Span, numKeys int)

CheckKeyCount checks that the number of keys in the provided span matches numKeys.

func CreateKVInterleavedTable Uses

func CreateKVInterleavedTable(t *testing.T, sqlDB *gosql.DB, numRows int)

CreateKVInterleavedTable is like CreateKVTable, but it interleaves table t.intlv inside of t.kv and adds rows to both.

func CreateKVTable Uses

func CreateKVTable(sqlDB *gosql.DB, name string, numRows int) error

CreateKVTable creates a basic table named t.<name> that stores key/value pairs with numRows of arbitrary data.

type CommandFilters Uses

type CommandFilters struct {
    // contains filtered or unexported fields

CommandFilters provides facilities for registering "TestingCommandFilters" (i.e. functions to be run on every replica command). CommandFilters is thread-safe. CommandFilters also optionally does replay protection if filters need it.

func CreateTestServerParams Uses

func CreateTestServerParams() (base.TestServerArgs, *CommandFilters)

CreateTestServerParams creates a set of params suitable for SQL tests. It enables some EndTxn sanity checking and installs a flexible TestingEvalFilter. TODO(andrei): this function is not used consistently by SQL tests. Figure out if the EndTxn checks are important.

func (*CommandFilters) AppendFilter Uses

func (c *CommandFilters) AppendFilter(
    filter kvserverbase.ReplicaCommandFilter, idempotent bool,
) func()

AppendFilter registers a filter function to run after all the previously registered filters. idempotent specifies if this filter can be safely run multiple times on the same command. If this property doesn't hold, CommandFilters will start tracking commands for replay protection, which might be expensive. Returns a closure that the client must run for doing cleanup when the filter should be deregistered.

func (*CommandFilters) RunFilters Uses

func (c *CommandFilters) RunFilters(args kvserverbase.FilterArgs) *roachpb.Error

RunFilters executes the registered filters, stopping at the first one that returns an error.

Package tests imports 14 packages (graph). Updated 2020-08-13. Refresh now. Tools for package owners.