Skip to content

Commit

Permalink
fixup! add new cache.Options field to customize transform
Browse files Browse the repository at this point in the history
attempt to fix race introduced in test by not referring to modified variable within callback
  • Loading branch information
alexzielenski committed Apr 14, 2022
1 parent 42167fb commit 7b28fd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,14 @@ var _ = Describe("Cache with transformers", func() {
})

BeforeEach(func() {
transformerHits = make(chan struct{}, 10)
hitsChan := make(chan struct{}, 10)

var err error
var transform = func(i interface{}) (interface{}, error) {
transformerHits <- struct{}{}
hitsChan <- struct{}{}
return i, nil
}
transformerHits = hitsChan

clien, err = client.New(cfg, client.Options{})
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 7b28fd8

Please sign in to comment.