From b541b4ea494333fd83cce981b478068515c5f4d8 Mon Sep 17 00:00:00 2001 From: Tom Thorogood Date: Thu, 9 Nov 2023 06:30:32 +1030 Subject: [PATCH] Use the correct root domain name in the proxy plugin's TestHealthX tests (#6395) When packing the empty domain name, miekg/dns can end up creating corrupt DNS messages. With some planned unpacking changes, this now trips an error condition and causes these tests to fail. Correct this by using the root domain explicitly as this gets correctly encoded on the wire. Signed-off-by: Tom Thorogood --- plugin/pkg/proxy/health_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/pkg/proxy/health_test.go b/plugin/pkg/proxy/health_test.go index 8d9acfb9c..bb93d7756 100644 --- a/plugin/pkg/proxy/health_test.go +++ b/plugin/pkg/proxy/health_test.go @@ -23,7 +23,7 @@ func TestHealth(t *testing.T) { }) defer s.Close() - hc := NewHealthChecker("TestHealth", transport.DNS, true, "") + hc := NewHealthChecker("TestHealth", transport.DNS, true, ".") hc.SetReadTimeout(10 * time.Millisecond) hc.SetWriteTimeout(10 * time.Millisecond) @@ -53,7 +53,7 @@ func TestHealthTCP(t *testing.T) { }) defer s.Close() - hc := NewHealthChecker("TestHealthTCP", transport.DNS, true, "") + hc := NewHealthChecker("TestHealthTCP", transport.DNS, true, ".") hc.SetTCPTransport() hc.SetReadTimeout(10 * time.Millisecond) hc.SetWriteTimeout(10 * time.Millisecond) @@ -84,7 +84,7 @@ func TestHealthNoRecursion(t *testing.T) { }) defer s.Close() - hc := NewHealthChecker("TestHealthNoRecursion", transport.DNS, false, "") + hc := NewHealthChecker("TestHealthNoRecursion", transport.DNS, false, ".") hc.SetReadTimeout(10 * time.Millisecond) hc.SetWriteTimeout(10 * time.Millisecond) @@ -108,7 +108,7 @@ func TestHealthTimeout(t *testing.T) { }) defer s.Close() - hc := NewHealthChecker("TestHealthTimeout", transport.DNS, false, "") + hc := NewHealthChecker("TestHealthTimeout", transport.DNS, false, ".") hc.SetReadTimeout(10 * time.Millisecond) hc.SetWriteTimeout(10 * time.Millisecond)