mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Minor fixes
This commit is contained in:
parent
3c31efe32f
commit
94097457fd
@ -163,13 +163,8 @@ func intervalMetricAvg(snapshot0, snapshot1 metricSnapshot, plLabel string) plMe
|
|||||||
// This test differs from TestPriorityLevelIsolation since TestPriorityLevelIsolation checks throughput instead
|
// 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
|
// 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.
|
// increase request execution time to make the system noise relatively insignificant.
|
||||||
//
|
|
||||||
// Secondarily, this test also checks the observed seat utilizations against values derived from expecting that
|
// Secondarily, this test also checks the observed seat utilizations against values derived from expecting that
|
||||||
// the throughput observed by the client equals the execution throughput observed by the server.
|
// the throughput observed by the client equals the execution throughput observed by the server.
|
||||||
//
|
|
||||||
// This test recognizes that there is noise in the measurements coming from uncontrolled overheads
|
|
||||||
// and unsynchronized reading of related quantities. This test takes as a relative error margin 2 times
|
|
||||||
// the smaller (of the two traffic classes) coefficient of variation of the client-observed latency.
|
|
||||||
func TestConcurrencyIsolation(t *testing.T) {
|
func TestConcurrencyIsolation(t *testing.T) {
|
||||||
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, genericfeatures.APIPriorityAndFairness, true)()
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, genericfeatures.APIPriorityAndFairness, true)()
|
||||||
// NOTE: disabling the feature should fail the test
|
// NOTE: disabling the feature should fail the test
|
||||||
@ -315,8 +310,9 @@ func TestConcurrencyIsolation(t *testing.T) {
|
|||||||
t.Logf("Error margin is %v", margin)
|
t.Logf("Error margin is %v", margin)
|
||||||
|
|
||||||
isConcurrencyExpected := func(name string, observed float64, expected float64) bool {
|
isConcurrencyExpected := func(name string, observed float64, expected float64) bool {
|
||||||
t.Logf("%v relative error is %v", name, math.Abs(expected-observed)/expected)
|
relativeErr := math.Abs(expected-observed) / expected
|
||||||
return math.Abs(expected-observed)/expected <= margin
|
t.Logf("%v relative error is %v", name, relativeErr)
|
||||||
|
return relativeErr <= margin
|
||||||
}
|
}
|
||||||
if !isConcurrencyExpected(plNoxu1.Name, noxu1ObservedConcurrency, noxu1ExpectedConcurrency) {
|
if !isConcurrencyExpected(plNoxu1.Name, noxu1ObservedConcurrency, noxu1ExpectedConcurrency) {
|
||||||
t.Errorf("Concurrency observed by noxu1 is off. Expected: %v, observed: %v", noxu1ExpectedConcurrency, noxu1ObservedConcurrency)
|
t.Errorf("Concurrency observed by noxu1 is off. Expected: %v, observed: %v", noxu1ExpectedConcurrency, noxu1ObservedConcurrency)
|
||||||
|
Loading…
Reference in New Issue
Block a user