deflake TSB deprovision test
@@ -8,8 +8,6 @@ import (
o "github.com/onsi/gomega"
"github.com/pborman/uuid"
"golang.org/x/net/context"
- "k8s.io/apimachinery/pkg/runtime/schema"
- "k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
@@ -17,7 +15,10 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/authentication/user"
+ "k8s.io/kubernetes/pkg/api/legacyscheme"
kapi "k8s.io/kubernetes/pkg/apis/core"
rbacapi "k8s.io/kubernetes/pkg/apis/rbac"
"k8s.io/kubernetes/test/e2e/framework"
@@ -289,6 +290,8 @@ var _ = g.Describe("[Conformance][templates] templateservicebroker end-to-end te
config, err := configapi.GetClientConfig(exutil.KubeConfigPath(), nil)
o.Expect(err).NotTo(o.HaveOccurred())
+ err = wait.Poll(time.Second*1, 5*time.Minute, func() (bool, error) {
+
// check the namespace is empty
for gvk := range legacyscheme.Scheme.AllKnownTypes() {
if gvk.Version == runtime.APIVersionInternal {
@@ -337,11 +340,14 @@ var _ = g.Describe("[Conformance][templates] templateservicebroker end-to-end te
meta, err := meta.Accessor(obj)
o.Expect(err).NotTo(o.HaveOccurred())
if meta.GetDeletionTimestamp() != nil {
- fmt.Fprintf(g.GinkgoWriter, "error: objects still exist with no deletion timestamp: %#v", list)
+ fmt.Fprintf(g.GinkgoWriter, "error: object still exists with no deletion timestamp: %#v", obj)
+ return false, nil
}
- o.Expect(meta.GetDeletionTimestamp()).NotTo(o.BeNil())
}
}
+ return true, nil
+ })
+ o.Expect(err).NotTo(o.HaveOccurred())
}
g.Context("", func() {
