From 8526ce7de396c298d87a855aeb25fe3d8f88ece9 Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 26 Feb 2018 10:46:47 -0500 Subject: [PATCH] don't use storage cache during apiserver unit test --- pkg/master/master_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/master/master_test.go b/pkg/master/master_test.go index a745791f9c9..bb4681e3b70 100644 --- a/pkg/master/master_test.go +++ b/pkg/master/master_test.go @@ -92,7 +92,10 @@ func setUp(t *testing.T) (*etcdtesting.EtcdTestServer, Config, informers.SharedI resourceEncoding.SetVersionEncoding(certificates.GroupName, *testapi.Certificates.GroupVersion(), schema.GroupVersion{Group: certificates.GroupName, Version: runtime.APIVersionInternal}) storageFactory := serverstorage.NewDefaultStorageFactory(*storageConfig, testapi.StorageMediaType(), legacyscheme.Codecs, resourceEncoding, DefaultAPIResourceConfigSource(), nil) - err := options.NewEtcdOptions(storageConfig).ApplyWithStorageFactoryTo(storageFactory, config.GenericConfig) + etcdOptions := options.NewEtcdOptions(storageConfig) + // unit tests don't need watch cache and it leaks lots of goroutines with etcd testing functions during unit tests + etcdOptions.EnableWatchCache = false + err := etcdOptions.ApplyWithStorageFactoryTo(storageFactory, config.GenericConfig) if err != nil { t.Fatal(err) }