# Packages
No description provided by the author
No description provided by the author
No description provided by the author
Package buildutil provides a constant CrdbTestBuild.
No description provided by the author
No description provided by the author
No description provided by the author
Package encoding exposes some utilities for encoding data as bytes.
No description provided by the author
No description provided by the author
Package grunning is a library that's able to retrieve on-CPU running time for individual goroutines.
No description provided by the author
Package interval provides two implementations for an interval tree.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package pretty prints documents based on a target line width.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
CombineUnique merges two ordered slices.
ConstantWithMetamorphicTestBool is like ConstantWithMetamorphicTestValue except it returns the non-default value half of the time (if running a metamorphic build).
ConstantWithMetamorphicTestBoolWithoutLogging is like ConstantWithMetamorphicTestBool except it does not log the value.
ConstantWithMetamorphicTestChoice is like ConstantWithMetamorphicTestValue except it returns a random choice (equally weighted) of the given values.
ConstantWithMetamorphicTestRange is like ConstantWithMetamorphicTestValue except instead of returning a single metamorphic test value, it returns a random test value in the semi-open range [min, max).
ConstantWithMetamorphicTestValue should be used to initialize "magic constants" that should be varied during test scenarios to check for bugs at boundary conditions.
CRC32 computes the Castagnoli CRC32 of the given data.
EnableRacePreemptionPoints enables goroutine preemption points declared with RacePreempt for builds using the race build tag.
EqualPtrFields uses reflection to check two "mirror" structures for matching pointer fields that point to the same object.
Every is a convenience constructor for an EveryN object that allows a log message every n duration.
ExpandTabsInRedactableBytes expands tabs in the redactable byte slice, so that columns are aligned.
Filter returns a new slice that only contains elements from collection that satisfy predicate.
GetSingleRune decodes the string s as a single rune if possible.
GetSmallTrace returns a comma-separated string containing the top 5 callers from a given skip level.
IsMetamorphicBuild returns whether this build is metamorphic.
MakeFNV64 initializes a new FNV64 hash state.
MakeStringListBuilder creates a StringListBuilder, which is used to print out lists of items.
MakeUnresolvedAddr populates an UnresolvedAddr from a network and raw address string.
MakeUnresolvedAddrWithDefaults creates a new UnresolvedAddr from a network and raw address string, using the following defaults if not given:
- Network: tcp - Host: local hostname or 127.0.0.1 - Port: given default port.
Map returns a new slice containing the results of fn for each element within collection.
MapFrom returns a map populated with keys and values returned by fn.
MoveTopKToFront moves the top K elements to the front.
NewUnresolvedAddr creates a new UnresolvedAddr from a network and raw address string.
Pluralize returns a single character 's' unless n == 1.
RacePreempt adds a goroutine preemption point if CockroachDB was built with the race build tag and preemption points have been enabled.
RandString generates a random string of the desired length from the input alphabet.
RemoveTrailingSpaces splits the input string into lines, trims any trailing spaces from each line, then puts the lines back together.
ToLowerSingleByte returns the lowercase of a given single ASCII byte.
TruncateString truncates a string to a given number of runes.
# Constants
DisableMetamorphicEnvVar can be used to disable metamorphic tests for sub-processes.
RaceEnabled is true if CockroachDB was built with the race build tag.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
IsolatedTestAddr is an address to use for tests that need extra isolation by using more addresses than 127.0.0.1 (support for this is platform-specific and only enabled on Linux).
TestAddr is an address to use for test servers.
# Structs
EveryN provides a way to rate limit spammy events.
FastIntMap is a replacement for map[int]int which is more efficient when both keys and values are small.
FNV64 encapsulates the hash state.
NoCopy may be embedded into structs which must not be copied after the first use.
StringListBuilder helps printing out lists of items.
UnresolvedAddr is an unresolved version of net.Addr.