Commit 598950ca authored by adrienpetel's avatar adrienpetel Committed by Brad Fitzpatrick

net: deflake TestLookupCNAME

Apply the same approach as in CL 102397.

Updates #24580

Change-Id: I65955f62a70807c87216519d03f3643a8f214dee
Reviewed-on: https://go-review.googlesource.com/103655Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 3b0b8bcd
......@@ -308,9 +308,20 @@ func TestLookupCNAME(t *testing.T) {
defer dnsWaitGroup.Wait()
for _, tt := range lookupCNAMETests {
attempts := 0
for i := 0; i < len(lookupCNAMETests); i++ {
tt := lookupCNAMETests[i]
cname, err := LookupCNAME(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 !strings.HasSuffix(cname, tt.cname) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment