aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2018-04-14 00:46:03 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2018-04-14 13:55:29 +0000
commit77faa652c1d3b351272940fe9bb0e6400dfc9f63 (patch)
tree1478be8e555100f93e3452f5719071f9b22750ee /src
parentd2c7dec183f0da628abf16848e9e92987feebe32 (diff)
downloadgo-77faa652c1d3b351272940fe9bb0e6400dfc9f63.tar.xz
net: use retry in TestLookupGmailNS
There are two flakes present on the dashboard for this test. Change-Id: I4abec972586314fbafe7db5760b91afd7ae47fd3 Reviewed-on: https://go-review.googlesource.com/106980 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/net/lookup_test.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go
index 7b69bae176..ab7306194f 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_test.go
@@ -154,6 +154,7 @@ var lookupGmailNSTests = []struct {
}
func TestLookupGmailNS(t *testing.T) {
+ t.Parallel()
if testenv.Builder() == "" {
testenv.MustHaveExternalNetwork(t)
}
@@ -162,12 +163,20 @@ func TestLookupGmailNS(t *testing.T) {
t.Skip("IPv4 is required")
}
- defer dnsWaitGroup.Wait()
-
- for _, tt := range lookupGmailNSTests {
+ attempts := 0
+ for i := 0; i < len(lookupGmailNSTests); i++ {
+ tt := lookupGmailNSTests[i]
nss, err := LookupNS(tt.name)
if err != nil {
testenv.SkipFlakyNet(t)
+ if attempts < len(backoffDuration) {
+ dur := backoffDuration[attempts]
+ t.Logf("backoff %v after failure %v\n", dur, err)
+ time.Sleep(dur)
+ attempts++
+ i--
+ continue
+ }
t.Fatal(err)
}
if len(nss) == 0 {