mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	turn on and off watch cache in integration test
This commit is contained in:
		@@ -77,6 +77,7 @@ var (
 | 
				
			|||||||
	fakeDocker2 = dockertools.NewFakeDockerClient()
 | 
						fakeDocker2 = dockertools.NewFakeDockerClient()
 | 
				
			||||||
	// Limit the number of concurrent tests.
 | 
						// Limit the number of concurrent tests.
 | 
				
			||||||
	maxConcurrency int
 | 
						maxConcurrency int
 | 
				
			||||||
 | 
						watchCache     bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	longTestTimeout = time.Second * 500
 | 
						longTestTimeout = time.Second * 500
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -169,6 +170,7 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
 | 
				
			|||||||
	masterConfig.ReadWritePort = portNumber
 | 
						masterConfig.ReadWritePort = portNumber
 | 
				
			||||||
	masterConfig.PublicAddress = hostIP
 | 
						masterConfig.PublicAddress = hostIP
 | 
				
			||||||
	masterConfig.CacheTimeout = 2 * time.Second
 | 
						masterConfig.CacheTimeout = 2 * time.Second
 | 
				
			||||||
 | 
						masterConfig.EnableWatchCache = watchCache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Create a master and install handlers into mux.
 | 
						// Create a master and install handlers into mux.
 | 
				
			||||||
	m, err := master.New(masterConfig)
 | 
						m, err := master.New(masterConfig)
 | 
				
			||||||
@@ -961,6 +963,8 @@ type testFunc func(*client.Client)
 | 
				
			|||||||
func addFlags(fs *pflag.FlagSet) {
 | 
					func addFlags(fs *pflag.FlagSet) {
 | 
				
			||||||
	fs.IntVar(
 | 
						fs.IntVar(
 | 
				
			||||||
		&maxConcurrency, "max-concurrency", -1, "Maximum number of tests to be run simultaneously. Unlimited if set to negative.")
 | 
							&maxConcurrency, "max-concurrency", -1, "Maximum number of tests to be run simultaneously. Unlimited if set to negative.")
 | 
				
			||||||
 | 
						fs.BoolVar(
 | 
				
			||||||
 | 
							&watchCache, "watch-cache", false, "Turn on watch cache on API server.")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,10 +55,14 @@ runTests() {
 | 
				
			|||||||
    KUBE_API_VERSIONS="v1,extensions/v1beta1" \
 | 
					    KUBE_API_VERSIONS="v1,extensions/v1beta1" \
 | 
				
			||||||
    "${KUBE_ROOT}/hack/test-go.sh" test/integration
 | 
					    "${KUBE_ROOT}/hack/test-go.sh" test/integration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  kube::log::status "Running integration test scenario"
 | 
					  kube::log::status "Running integration test scenario with watch cache on"
 | 
				
			||||||
 | 
					 | 
				
			||||||
  KUBE_API_VERSIONS="v1,extensions/v1beta1" KUBE_TEST_API_VERSIONS="$1" "${KUBE_OUTPUT_HOSTBIN}/integration" --v=${LOG_LEVEL} \
 | 
					  KUBE_API_VERSIONS="v1,extensions/v1beta1" KUBE_TEST_API_VERSIONS="$1" "${KUBE_OUTPUT_HOSTBIN}/integration" --v=${LOG_LEVEL} \
 | 
				
			||||||
    --max-concurrency="${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}"
 | 
					    --max-concurrency="${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}" --watch-cache=true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  kube::log::status "Running integration test scenario with watch cache off"
 | 
				
			||||||
 | 
					  KUBE_API_VERSIONS="v1,extensions/v1beta1" KUBE_TEST_API_VERSIONS="$1" "${KUBE_OUTPUT_HOSTBIN}/integration" --v=${LOG_LEVEL} \
 | 
				
			||||||
 | 
					    --max-concurrency="${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY}" --watch-cache=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cleanup
 | 
					  cleanup
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user