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
5 changes: 3 additions & 2 deletions internal/cache/memory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ func TestMemoryCache_ConcurrentAccess(t *testing.T) {
const numGoroutines = 100
const numOperations = 100

var wg sync.WaitGroup

// Concurrent writes
t.Run("Concurrent writes", func(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
wg.Add(numGoroutines)
for i := range numGoroutines {
go func(_ int) {
Expand All @@ -203,6 +202,7 @@ func TestMemoryCache_ConcurrentAccess(t *testing.T) {
// Concurrent reads and writes
t.Run("Concurrent reads and writes", func(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
// Pre-populate cache
for range 10 {
key := "concurrent-key"
Expand Down Expand Up @@ -244,6 +244,7 @@ func TestMemoryCache_ConcurrentAccess(t *testing.T) {
// Concurrent deletes
t.Run("Concurrent deletes", func(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
// Pre-populate cache
for range numGoroutines {
key := "delete-key"
Expand Down
Loading