Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions pkg/report/strings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,10 @@ func TestStringPoolRaceCondition(t *testing.T) {
pool := NewStringPool()

var wg sync.WaitGroup
wg.Add(numGoroutines * 3)

// Concurrent interning of identical strings
for range numGoroutines {
wg.Go(func() {
defer wg.Done()
for range numOps {
pool.Intern("shared")
}
Expand All @@ -238,17 +236,16 @@ func TestStringPoolRaceCondition(t *testing.T) {
// Concurrent interning of unique strings
for i := range numGoroutines {
wg.Go(func() {
defer wg.Done()
for j := range numOps {
pool.Intern(fmt.Sprintf("unique-%d-%d", i, j))
}
})
}

// Concurrent clear operations
for range numGoroutines {
// Use a small number of goroutines to exercise the race detector without triggering
// resize contention in xsync.Map.
for range 10 {
wg.Go(func() {
defer wg.Done()
for range numOps {
pool.clear()
}
Expand Down