Merge pull request #31042 from TerryHowe/fix-test-teardown-dns-data-race

fix: test teardown dns data race
pull/31051/head
Robert Sirchia 2 months ago committed by GitHub
commit 49e82c1fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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()

Loading…
Cancel
Save