Clean shutdown of certificates integration tests

This commit is contained in:
Wojciech Tyczyński
2022-05-30 20:42:00 +02:00
parent 783da34f54
commit d9d46d5326
2 changed files with 3 additions and 10 deletions

View File

@@ -51,12 +51,12 @@ import (
func TestCSRDuration(t *testing.T) {
t.Parallel()
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
t.Cleanup(cancel)
s := kubeapiservertesting.StartTestServerOrDie(t, nil, nil, framework.SharedEtcd())
t.Cleanup(s.TearDownFn)
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
t.Cleanup(cancel)
// assert that the metrics we collect during the test run match expectations
// we have 7 valid test cases below that request a duration of which 6 should have their duration honored
wantMetricStrings := []string{