package
25.1.0+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Packages
Package bazelcodecover allows instrumented binaries to output code coverage data.
Package floatcmp provides functions for determining float values to be equal if they are within a tolerance.
Package lint tests Go code for policy and style violations, as well as detecting suspicious constructs that are typically bugs.
# Functions
AllocProfileDiff writes two alloc profiles, one before running closure and one after.
BackupTestingBucket returns the name of the external storage bucket that should be used in a test run.
BackupTestingBucketLongTTL returns the name of the external storage bucket that should be used in a test run where the bucket's content may inform a debugging investigation.
CaptureSideEyeSnapshot captures a Side-Eye snapshot if the SIDE_EYE_TOKEN env var is set.
HookGlobal provides a way to temporarily set a package-global variable to a new value for the duration of a test.
IsError returns true if the error string matches the supplied regex.
IsPError returns true if pErr's message matches the supplied regex.
MakeKey makes a new key which is the concatenation of the given inputs, in order.
MatchInOrder matches interprets the given slice of strings as a slice of regular expressions and checks that they match, in order and without overlap, against the given string.
NewPartitionableConn wraps serverConn in a PartitionableConn.
ReadAllFiles reads all of the files matching pattern, thus ensuring they are in the OS buffer cache.
RunTrueAndFalse calls the provided function in a subtest, first with the boolean argument set to false and next with the boolean argument set to true.
RunValues calls the provided function in a subtest for each of the provided values.
SortStructs sorts the given slice of structs using the given fields as the ordered sort keys.
StartExecTrace starts a Go execution trace and returns a handle that allows stopping it.
SucceedsSoon fails the test (with t.Fatal) unless the supplied function runs without error within a preset maximum duration.
SucceedsSoonError returns an error unless the supplied function runs without error within a preset maximum duration.
SucceedsWithin fails the test (with t.Fatal) unless the supplied function runs without error within the given duration.
SucceedsWithinError returns an error unless the supplied function runs without error within the given duration.
TempDir creates a directory and a function to clean it up at the end of the test.
TestingHook sets `*ptr = val` and returns a closure for restoring `*ptr` to its original value.
TestingRequestFilterRetryTxnWithPrefix returns a TestingRequestFilter that forces maxCount retry errors for each transaction whose debug name begins with the given prefix.
WriteProfile serialized the pprof profile with the given name to a file at the given path.
# Constants
DefaultSucceedsSoonDuration is the maximum amount of time unittests will wait for a condition to become true.
RaceSucceedsSoonDuration is the maximum amount of time unittests will wait for a condition to become true when running with the race detector enabled.
# Structs
PartitionableConn is an implementation of net.Conn that allows the client->server and/or the server->client directions to be temporarily partitioned.
# Interfaces
TestErrorer is like Fataler but it only needs a Error method.
TestFataler is a slimmed down version of testing.TB for use in helper functions by testing contexts which do not come from the stdlib testing package.
TestFatalerLogger is like Fataler but it also needs a Log method.
TestNamedFatalerLogger is like Fataler but it also needs a Name method.