From ed74de833dcbd1ac6b295a7ac525efe7f6c1152f Mon Sep 17 00:00:00 2001 From: Chih-Chieh Yang <7364402+cyang49@users.noreply.github.com> Date: Sat, 30 Jul 2022 00:13:48 +0000 Subject: [PATCH] Add comment for the reason this test is needed --- .../apiserver/flowcontrol/concurrency_util_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/integration/apiserver/flowcontrol/concurrency_util_test.go b/test/integration/apiserver/flowcontrol/concurrency_util_test.go index 5ff9d65464a..2ca44a24f74 100644 --- a/test/integration/apiserver/flowcontrol/concurrency_util_test.go +++ b/test/integration/apiserver/flowcontrol/concurrency_util_test.go @@ -81,6 +81,16 @@ func setupWithAuthorizer(t testing.TB, maxReadonlyRequestsInFlight, maxMutatingR return kubeConfig, tearDownFn } +// This integration test checks the client-side expected concurrency and the server-side observed concurrency +// to make sure that they are close within a small error bound and that the priority levels are isolated. +// This test differs from TestPriorityLevelIsolation since TestPriorityLevelIsolation checks throughput instead +// of concurrency. In order to mitigate the effects of system noise, authorization webhook is used to artificially +// increase request execution time to make the system noise relatively insignificant. +// This test calculates the server-side observed concurrency from average priority level seat utilization APF metric. +// It also assumes that +// (server-side request execution throughput) == (client-side request throughput) and derives a formula to +// calculate the client-side expected concurrency. The two are compared and a small error bound is determined +// from estimating the noise using 2*(standard deviation of requenst latency)/(avg request latency). func TestConcurrencyIsolation(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, genericfeatures.APIPriorityAndFairness, true)() // NOTE: disabling the feature should fail the test