From 12a2221db2264342f9fe449770c1eea7d9730624 Mon Sep 17 00:00:00 2001 From: Maisem Ali Date: Wed, 28 Jun 2023 12:09:52 -0700 Subject: [PATCH] cmd/testwrapper/flakytest: clearly describe why TestFlakeRun fails Fixes #8474 Signed-off-by: Maisem Ali --- cmd/testwrapper/flakytest/flakytest_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/testwrapper/flakytest/flakytest_test.go b/cmd/testwrapper/flakytest/flakytest_test.go index 207a27de7..85e77a939 100644 --- a/cmd/testwrapper/flakytest/flakytest_test.go +++ b/cmd/testwrapper/flakytest/flakytest_test.go @@ -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) { Mark(t, "https://github.com/tailscale/tailscale/issues/0") // random issue e := os.Getenv(FlakeAttemptEnv) @@ -35,6 +38,6 @@ func TestFlakeRun(t *testing.T) { t.Skip("not running in testwrapper") } if e == "1" { - t.Fatal("failing on purpose") + t.Fatal("First run in testwrapper, failing so that test is retried. This is expected.") } }