From 82bc9adcc20711f6159bdd88e3d762e5782c8676 Mon Sep 17 00:00:00 2001 From: Terry Howe Date: Wed, 9 Jul 2025 12:59:19 -0600 Subject: [PATCH] fix: test teardown dns data race Signed-off-by: Terry Howe --- pkg/registry/utils_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/registry/utils_test.go b/pkg/registry/utils_test.go index e8fcba4e3..b270e51cc 100644 --- a/pkg/registry/utils_test.go +++ b/pkg/registry/utils_test.go @@ -29,6 +29,7 @@ import ( "os" "path/filepath" "strings" + "sync" "time" "github.com/distribution/distribution/v3/configuration" @@ -172,6 +173,9 @@ func setup(suite *TestSuite, tlsEnabled, insecure bool) *registry.Registry { } func teardown(suite *TestSuite) { + var lock sync.Mutex + lock.Lock() + defer lock.Unlock() if suite.srv != nil { mockdns.UnpatchNet(net.DefaultResolver) suite.srv.Close()