Skip to content

Commit

Permalink
Merge pull request #92920 from gaurav1086/TestWatchBasedManager_fix_d…
Browse files Browse the repository at this point in the history
…eadlock

[test/kubelet]: Fix deadlock in watch manager test
  • Loading branch information
k8s-ci-robot committed Aug 27, 2020
2 parents 06eb495 + 22dc474 commit 343596b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/integration/kubelet/watch_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func TestWatchBasedManager(t *testing.T) {
server := kubeapiservertesting.StartTestServerOrDie(t, nil, nil, framework.SharedEtcd())
defer server.TearDownFn()

const n = 10
server.ClientConfig.QPS = 10000
server.ClientConfig.Burst = 10000
client, err := kubernetes.NewForConfig(server.ClientConfig)
Expand All @@ -65,8 +66,8 @@ func TestWatchBasedManager(t *testing.T) {
// create 1000 secrets in parallel
t.Log(time.Now(), "creating 1000 secrets")
wg := sync.WaitGroup{}
errCh := make(chan error, 1)
for i := 0; i < 10; i++ {
errCh := make(chan error, n)
for i := 0; i < n; i++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
Expand All @@ -93,8 +94,8 @@ func TestWatchBasedManager(t *testing.T) {

// fetch all secrets
wg = sync.WaitGroup{}
errCh = make(chan error, 1)
for i := 0; i < 10; i++ {
errCh = make(chan error, n)
for i := 0; i < n; i++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
Expand Down

0 comments on commit 343596b

Please sign in to comment.