From 45211dc72f700de563bbafc2f2e1ebb3c55b10da Mon Sep 17 00:00:00 2001 From: Zhengke Zhou Date: Tue, 27 May 2025 20:40:09 +0800 Subject: [PATCH] chore: Adjust test and add comment about DNS resolution issue for failing tests (#16200) * chore: Add comment about DNS resolution issue for failing tests Signed-off-by: zhengkezhou1 * remove unexported-return Signed-off-by: zhengkezhou1 --------- Signed-off-by: zhengkezhou1 --- discovery/zookeeper/zookeeper_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discovery/zookeeper/zookeeper_test.go b/discovery/zookeeper/zookeeper_test.go index 5f1b75c088..e496dfef51 100644 --- a/discovery/zookeeper/zookeeper_test.go +++ b/discovery/zookeeper/zookeeper_test.go @@ -26,9 +26,11 @@ func TestMain(m *testing.M) { goleak.VerifyTestMain(m) } +// TestNewDiscoveryError can fail if the DNS resolver mistakenly resolves the domain below. +// See https://github.com/prometheus/prometheus/issues/16191 for a precedent. func TestNewDiscoveryError(t *testing.T) { _, err := NewDiscovery( - []string{"unreachable.test"}, + []string{"unreachable.invalid"}, time.Second, []string{"/"}, nil, func(_ []byte, _ string) (model.LabelSet, error) { return nil, nil })