mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Fix data race issue in unit test
TestDispatchingBookmarkEventsWithConcurrentStop can use processEvent instead of `dispatchEvent` to avoid data race conditions with `Cacher.watchersBuffer`.
This commit is contained in:
parent
84dc704679
commit
7dc075673c
@ -793,7 +793,7 @@ func TestDispatchingBookmarkEventsWithConcurrentStop(t *testing.T) {
|
|||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
wg.Add(2)
|
wg.Add(2)
|
||||||
go func() {
|
go func() {
|
||||||
cacher.dispatchEvent(bookmark)
|
cacher.processEvent(bookmark)
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user