scenarioharness

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdempotencyHeaders

func IdempotencyHeaders(value string) http.Header

func JSONBody

func JSONBody(value any) io.Reader

func RequestJSON

func RequestJSON[T any](
	ctx context.Context,
	client *secondboxclient.Client,
	operationID string,
	options secondboxclient.CallOptions,
) (T, error)

func RestartService added in v0.11.0

func RestartService(ctx context.Context, start func(context.Context) error, running func(context.Context) (bool, error)) error

RestartService bounds both start attempts and state inspection by ctx. Each attempt gets half the remaining budget, leaving time for one retry even when the first start command hangs. Callers retain command output for diagnostics.

func RevisionETag

func RevisionETag(revision int64) string

func WaitSandbox

func WaitSandbox(
	ctx context.Context,
	handle *secondboxclient.SandboxHandle,
	states []secondboxclient.SandboxState,
	maximumWaitRequest time.Duration,
) (secondboxclient.Sandbox, error)

Types

type Clients

type Clients struct {
	Admin      *secondboxclient.Client
	Subject    *secondboxclient.Client
	HTTPClient *http.Client
}

func NewClients

func NewClients(
	baseURL string,
	platformToken string,
	applicationToken string,
	tenantRef string,
	subjectRef string,
	timeout time.Duration,
) (Clients, error)

type TimeoutDiagnosticsTransport added in v0.12.0

type TimeoutDiagnosticsTransport struct {
	Base    http.RoundTripper
	Capture func()
	// contains filtered or unexported fields
}

TimeoutDiagnosticsTransport captures stack state at the first HTTP timeout, before fixture cleanup or subsequent polling can obscure the original failure. It preserves the response and error, including the client's timeout semantics.

func (*TimeoutDiagnosticsTransport) RoundTrip added in v0.12.0

func (transport *TimeoutDiagnosticsTransport) RoundTrip(request *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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