]> Cypherpunks repositories - gostls13.git/commitdiff
net: root the nodata test domain to avoid search domains
authorMateusz Poliwczak <mpoliwczak34@gmail.com>
Mon, 15 May 2023 09:33:40 +0000 (09:33 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 22:38:08 +0000 (22:38 +0000)
I came across similar issue in CL 455275.
Without rooting this, the search domains might affect
the query, so the test might not prove the right thing.
The search domain will cause a change from no data
to NXDOMAIN error.

Change-Id: I59f4de2635f03c69adf29b74e25e4ebd71e7413b
GitHub-Last-Rev: 3a086c74f1453e4d1f2e88631ac835389984da17
GitHub-Pull-Request: golang/go#60197
Reviewed-on: https://go-review.googlesource.com/c/go/+/494896
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>

src/net/lookup_test.go

index 0ea681f834569a930182eeae4f38ebdfe820a7b9..0689c19c3c68c7c94e269ad4eafe9fc86248490e 100644 (file)
@@ -1425,7 +1425,7 @@ func testLookupNoData(t *testing.T, prefix string) {
        for {
                // Domain that doesn't have any A/AAAA RRs, but has different one (in this case a TXT),
                // so that it returns an empty response without any error codes (NXDOMAIN).
-               _, err := LookupHost("golang.rsc.io")
+               _, err := LookupHost("golang.rsc.io.")
                if err == nil {
                        t.Errorf("%v: unexpected success", prefix)
                        return