mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	integration: Randomize the order of the integration tests.
This commit is contained in:
		@@ -999,25 +999,25 @@ func main() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Only run at most maxConcurrency tests in parallel.
 | 
						// Only run at most maxConcurrency tests in parallel.
 | 
				
			||||||
	numFinishedTests := 0
 | 
						if maxConcurrency <= 0 {
 | 
				
			||||||
	for numFinishedTests < len(testFuncs) {
 | 
							maxConcurrency = len(testFuncs)
 | 
				
			||||||
		numTestsToRun := len(testFuncs) - numFinishedTests
 | 
					 | 
				
			||||||
		if maxConcurrency > 0 && numTestsToRun > maxConcurrency {
 | 
					 | 
				
			||||||
			numTestsToRun = maxConcurrency
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
		glog.Infof("Running %d tests in parallel.", numTestsToRun)
 | 
						glog.Infof("Running %d tests in parallel.", maxConcurrency)
 | 
				
			||||||
 | 
						ch := make(chan struct{}, maxConcurrency)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	var wg sync.WaitGroup
 | 
						var wg sync.WaitGroup
 | 
				
			||||||
		wg.Add(numTestsToRun)
 | 
						wg.Add(len(testFuncs))
 | 
				
			||||||
		for i := 0; i < numTestsToRun; i++ {
 | 
						for i := range testFuncs {
 | 
				
			||||||
			f := testFuncs[i+numFinishedTests]
 | 
							f := testFuncs[i]
 | 
				
			||||||
		go func() {
 | 
							go func() {
 | 
				
			||||||
 | 
								ch <- struct{}{}
 | 
				
			||||||
			f(kubeClient)
 | 
								f(kubeClient)
 | 
				
			||||||
 | 
								<-ch
 | 
				
			||||||
			wg.Done()
 | 
								wg.Done()
 | 
				
			||||||
		}()
 | 
							}()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	wg.Wait()
 | 
						wg.Wait()
 | 
				
			||||||
		numFinishedTests += numTestsToRun
 | 
						close(ch)
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Check that kubelet tried to make the containers.
 | 
						// Check that kubelet tried to make the containers.
 | 
				
			||||||
	// Using a set to list unique creation attempts. Our fake is
 | 
						// Using a set to list unique creation attempts. Our fake is
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user