aboutsummaryrefslogtreecommitdiff
path: root/src/net/conf_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2026-01-27 09:05:48 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2026-02-02 10:15:12 -0800
commit6de7a19fea07bf8a9a54b7d9d3dc839fe2ea9d33 (patch)
tree6f0726cffb6ddff44b770e7e5fc08e4185af8707 /src/net/conf_test.go
parent11d5284363ed88b8cc8ec6e68db80a16b2f9e708 (diff)
downloadgo-6de7a19fea07bf8a9a54b7d9d3dc839fe2ea9d33.tar.xz
net: don't wait 5 seconds to re-read /etc/resolv.conf
If a Go process starts up, finds /etc/resolv.conf empty, then the DHCP client writes /etc/resolv.conf, the Go program would find itself broken for up to 5 seconds. We noticed this during integration tests in ephemeral VMs using gokrazy that boot into our application. Change-Id: Ia64c2b5c698a4ee3efc15d8a8f1850c47e531b84 Reviewed-on: https://go-review.googlesource.com/c/go/+/739620 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/conf_test.go')
-rw-r--r--src/net/conf_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/conf_test.go b/src/net/conf_test.go
index 6ebd6be635..075253cbc1 100644
--- a/src/net/conf_test.go
+++ b/src/net/conf_test.go
@@ -396,7 +396,7 @@ func TestConfHostLookupOrder(t *testing.T) {
defer conf.teardown()
for _, tt := range tests {
- if !conf.forceUpdateConf(tt.resolv, time.Now().Add(time.Hour)) {
+ if !conf.forceUpdateConf(tt.resolv, distantFuture) {
t.Errorf("%s: failed to change resolv config", tt.name)
}
for _, ht := range tt.hostTests {