cmd/testwrapper/flakytest: clearly describe why TestFlakeRun fails

Fixes #8474

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/8483/head
Maisem Ali 1 year ago committed by Maisem Ali
parent 97ee0bc685
commit 12a2221db2

@ -28,6 +28,9 @@ func TestIssueFormat(t *testing.T) {
} }
} }
// TestFlakeRun is a test that fails when run in the testwrapper
// for the first time, but succeeds on the second run.
// It's used to test whether the testwrapper retries flaky tests.
func TestFlakeRun(t *testing.T) { func TestFlakeRun(t *testing.T) {
Mark(t, "https://github.com/tailscale/tailscale/issues/0") // random issue Mark(t, "https://github.com/tailscale/tailscale/issues/0") // random issue
e := os.Getenv(FlakeAttemptEnv) e := os.Getenv(FlakeAttemptEnv)
@ -35,6 +38,6 @@ func TestFlakeRun(t *testing.T) {
t.Skip("not running in testwrapper") t.Skip("not running in testwrapper")
} }
if e == "1" { if e == "1" {
t.Fatal("failing on purpose") t.Fatal("First run in testwrapper, failing so that test is retried. This is expected.")
} }
} }

Loading…
Cancel
Save