mirror of
https://github.com/coredns/coredns.git
synced 2026-02-17 12:43:09 -05:00
chore: bump minimum Go version to 1.25 (#7788)
This commit is contained in:
6
plugin/pkg/cache/shard_test.go
vendored
6
plugin/pkg/cache/shard_test.go
vendored
@@ -102,12 +102,10 @@ func TestShardEvictParallel(t *testing.T) {
|
||||
start := make(chan struct{})
|
||||
var wg sync.WaitGroup
|
||||
for range shardSize {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
wg.Go(func() {
|
||||
<-start
|
||||
s.Evict()
|
||||
wg.Done()
|
||||
}()
|
||||
})
|
||||
}
|
||||
close(start) // start evicting in parallel
|
||||
wg.Wait()
|
||||
|
||||
@@ -124,30 +124,26 @@ func TestConcurrentAccess(t *testing.T) {
|
||||
|
||||
// Test concurrent Int() calls
|
||||
for range numGoroutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for range numOperations {
|
||||
val := r.Int()
|
||||
if val < 0 {
|
||||
errors <- nil
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Test concurrent Perm() calls
|
||||
for range numGoroutines {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
wg.Go(func() {
|
||||
for range numOperations {
|
||||
perm := r.Perm(5)
|
||||
if len(perm) != 5 {
|
||||
errors <- nil
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
@@ -64,8 +64,7 @@ func TestDoDupSuppress(t *testing.T) {
|
||||
const n = 10
|
||||
var wg sync.WaitGroup
|
||||
for range n {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
wg.Go(func() {
|
||||
v, err := g.Do(1, fn)
|
||||
if err != nil {
|
||||
t.Errorf("Do error: %v", err)
|
||||
@@ -73,8 +72,7 @@ func TestDoDupSuppress(t *testing.T) {
|
||||
if v.(string) != "bar" {
|
||||
t.Errorf("Got %q; want %q", v, "bar")
|
||||
}
|
||||
wg.Done()
|
||||
}()
|
||||
})
|
||||
}
|
||||
time.Sleep(100 * time.Millisecond) // let goroutines above block
|
||||
c <- "bar"
|
||||
|
||||
Reference in New Issue
Block a user