tailscale.comtailscale.com/cmd/testwrapper/flakytest Index | Files

package flakytest

import "tailscale.com/cmd/testwrapper/flakytest"

Package flakytest contains test helpers for marking a test as flaky. For tests run using cmd/testwrapper, a failed flaky test will cause tests to be re-run a few time until they succeed or exceed our iteration limit.

Index

Constants

const FlakeAttemptEnv = "TS_TESTWRAPPER_ATTEMPT"

FlakeAttemptEnv is an environment variable that is set by cmd/testwrapper when a flaky test is being (re)tried. It contains the attempt number, starting at 1.

const FlakyTestLogMessage = "flakytest: this is a known flaky test"

FlakyTestLogMessage is a sentinel value that is printed to stderr when a flaky test is marked. This is used by cmd/testwrapper to detect flaky tests and retry them.

Functions

func Mark

func Mark(t testing.TB, issue string)

Mark sets the current test as a flaky test, such that if it fails, it will be retried a few times on failure. issue must be a GitHub issue that tracks the status of the flaky test being marked, of the format:

https://github.com/tailscale/myRepo-H3re/issues/12345

func Marked

func Marked(t testing.TB) bool

Marked reports whether the current test or one of its parents was marked flaky.

Source Files

flakytest.go

Version
v1.84.2 (latest)
Published
Jun 9, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
43 minutes ago

Tools for package owners.