diff --git a/internal/backend/backend_test.go b/internal/backend/backend_test.go index 43d7761..178bca2 100644 --- a/internal/backend/backend_test.go +++ b/internal/backend/backend_test.go @@ -159,7 +159,9 @@ func TestConcurrentFetch(t *testing.T) { }() <-fetchStarted - errCh <- fmt.Errorf("error fetching value") + go func() { + errCh <- fmt.Errorf("error fetching value") + }() v, err := b.Fetch("key", func() (string, error) { return "value", nil @@ -185,7 +187,9 @@ func TestConcurrentFetch(t *testing.T) { }() <-fetchStarted - valueCh <- "value" + go func() { + valueCh <- "value" + }() v, err := b.Fetch("key", func() (string, error) { return "value1", nil