Clean shutdown of apiserver integration tests

This commit is contained in:
Wojciech Tyczyński
2022-07-18 20:28:14 +02:00
parent 122254fc01
commit e9e494e14a
5 changed files with 33 additions and 10 deletions

View File

@@ -401,10 +401,14 @@ func TestListOptions(t *testing.T) {
}
// compact some of the revision history in etcd so we can test "too old" resource versions
_, kvClient, err := integration.GetEtcdClients(*storageTransport)
rawClient, kvClient, err := integration.GetEtcdClients(*storageTransport)
if err != nil {
t.Fatal(err)
}
// kvClient is a wrapper around rawClient and to avoid leaking goroutines we need to
// close the client (which we can do by closing rawClient).
defer rawClient.Close()
revision, err := strconv.Atoi(oldestUncompactedRv)
if err != nil {
t.Fatal(err)