From 2cefd12a1bf7ee1d1aad03e17c4680d4b611d6da Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 6 Apr 2016 19:02:27 +0000 Subject: net, runtime: skip flaky tests on OpenBSD Flaky tests are a distraction and cover up real problems. File bugs instead and mark them as flaky. This moves the net/http flaky test flagging mechanism to internal/testenv. Updates #15156 Updates #15157 Updates #15158 Change-Id: I0e561cd2a09c0dec369cd4ed93bc5a2b40233dfe Reviewed-on: https://go-review.googlesource.com/21614 Reviewed-by: Matthew Dempsky Run-TryBot: Brad Fitzpatrick --- src/internal/testenv/testenv.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/internal/testenv') diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go index e751e0cf11..9e684e3034 100644 --- a/src/internal/testenv/testenv.go +++ b/src/internal/testenv/testenv.go @@ -11,6 +11,7 @@ package testenv import ( + "flag" "os" "os/exec" "path/filepath" @@ -124,3 +125,11 @@ func MustHaveExternalNetwork(t *testing.T) { t.Skipf("skipping test: no external network in -short mode") } } + +var flaky = flag.Bool("flaky", false, "run known-flaky tests too") + +func SkipFlaky(t *testing.T, issue int) { + if !*flaky { + t.Skipf("skipping known flaky test without the -flaky flag; see golang.org/issue/%d", issue) + } +} -- cgit v1.3-6-g1900