mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
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 <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com>
This commit is contained in:
parent
f798dc6825
commit
32964f9dce
|
@ -16,6 +16,7 @@ import (
|
||||||
"regexp"
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -171,6 +172,14 @@ func TestLookupPTR(t *testing.T) {
|
||||||
for _, addr := range lookupTestIPs {
|
for _, addr := range lookupTestIPs {
|
||||||
names, err := LookupAddr(addr)
|
names, err := LookupAddr(addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// The DNSError type stores the error as a string, so it cannot wrap the
|
||||||
|
// original error code and we cannot check for it here. However, we can at
|
||||||
|
// least use its error string to identify the correct localized text for
|
||||||
|
// the error to skip.
|
||||||
|
var DNS_ERROR_RCODE_SERVER_FAILURE syscall.Errno = 9002
|
||||||
|
if strings.HasSuffix(err.Error(), DNS_ERROR_RCODE_SERVER_FAILURE.Error()) {
|
||||||
|
testenv.SkipFlaky(t, 38111)
|
||||||
|
}
|
||||||
t.Errorf("failed %s: %s", addr, err)
|
t.Errorf("failed %s: %s", addr, err)
|
||||||
}
|
}
|
||||||
if len(names) == 0 {
|
if len(names) == 0 {
|
||||||
|
|
Loading…
Reference in a new issue