testserver

package
Version: v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestConfig

func NewTestConfig(t *testing.T) *embed.Config

NewTestConfig returns a configuration for an embedded etcd server. The configuration is based on embed.NewConfig(), with the following adjustments: * sets UnsafeNoFsync = true to improve test performance (only reasonable in a test-only

single-member server we never intend to restart or keep data from)

* uses free ports for client and peer listeners * cleans up the data directory on test termination * silences server logs other than errors

func RunEtcd

func RunEtcd(t *testing.T, cfg *embed.Config) *clientv3.Client

RunEtcd starts an embedded etcd server with the provided config (or NewTestConfig(t) if nil), and returns a client connected to the server. The server is terminated when the test ends.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL