File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -167,13 +167,19 @@ var _ = Describe("Cache with transformers", func() {
167
167
})
168
168
169
169
BeforeEach (func () {
170
- transformerHits = make (chan struct {}, 10 )
170
+ hitsChan : = make (chan struct {}, 10 )
171
171
172
172
var err error
173
173
var transform = func (i interface {}) (interface {}, error ) {
174
- transformerHits <- struct {}{}
174
+ select {
175
+ case hitsChan <- struct {}{}:
176
+ // Notified the hit
177
+ default :
178
+ // don't block on sending
179
+ }
175
180
return i , nil
176
181
}
182
+ transformerHits = hitsChan
177
183
178
184
clien , err = client .New (cfg , client.Options {})
179
185
Expect (err ).NotTo (HaveOccurred ())
@@ -218,7 +224,6 @@ var _ = Describe("Cache with transformers", func() {
218
224
informerCacheCancel ()
219
225
220
226
// Reset channel for future tests
221
- close (transformerHits )
222
227
transformerHits = nil
223
228
})
224
229
You can’t perform that action at this time.
0 commit comments