Skip to content

Commit 32964f9

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
net: skip TestLookupPTR when LookupAddr fails with "DNS server failure"
For #38111. Change-Id: I43bdd756bde0adcd156cf9750b49b3b989304df7 Reviewed-on: https://go-review.googlesource.com/c/go/+/427915 Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]>
1 parent f798dc6 commit 32964f9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/net/lookup_windows_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"regexp"
1717
"sort"
1818
"strings"
19+
"syscall"
1920
"testing"
2021
)
2122

@@ -171,6 +172,14 @@ func TestLookupPTR(t *testing.T) {
171172
for _, addr := range lookupTestIPs {
172173
names, err := LookupAddr(addr)
173174
if err != nil {
175+
// The DNSError type stores the error as a string, so it cannot wrap the
176+
// original error code and we cannot check for it here. However, we can at
177+
// least use its error string to identify the correct localized text for
178+
// the error to skip.
179+
var DNS_ERROR_RCODE_SERVER_FAILURE syscall.Errno = 9002
180+
if strings.HasSuffix(err.Error(), DNS_ERROR_RCODE_SERVER_FAILURE.Error()) {
181+
testenv.SkipFlaky(t, 38111)
182+
}
174183
t.Errorf("failed %s: %s", addr, err)
175184
}
176185
if len(names) == 0 {

0 commit comments

Comments
 (0)