From 6496ac35019d19dfbfb2175f1a7a47fe4cdeab7c Mon Sep 17 00:00:00 2001 From: hasbro17 Date: Tue, 2 May 2017 16:37:02 -0700 Subject: [PATCH] upgradetest/TestResize: wait for cluster TPR, remove unnecessary waits --- test/e2e/upgradetest/upgrade_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/upgradetest/upgrade_test.go b/test/e2e/upgradetest/upgrade_test.go index 615e181..7797a68 100644 --- a/test/e2e/upgradetest/upgrade_test.go +++ b/test/e2e/upgradetest/upgrade_test.go @@ -34,7 +34,10 @@ func TestResize(t *testing.T) { if err != nil { t.Fatal(err) } - time.Sleep(10 * time.Second) + if err = k8sutil.WaitEtcdTPRReady(testF.KubeCli.CoreV1().RESTClient(), 3*time.Second, 30*time.Second, testF.KubeNS); err != nil { + t.Fatalf("failed to see cluster TPR get created in time: %v", err) + } + testClus, err := e2eutil.CreateCluster(t, testF.KubeCli, testF.KubeNS, e2eutil.NewCluster("upgrade-test-", 3)) if err != nil { t.Fatal(err) @@ -43,7 +46,6 @@ func TestResize(t *testing.T) { if err := e2eutil.DeleteCluster(t, testF.KubeCli, testClus, &e2eutil.StorageCheckerOptions{}); err != nil { t.Fatal(err) } - time.Sleep(10 * time.Second) }() _, err = e2eutil.WaitUntilSizeReached(t, testF.KubeCli, 3, 60*time.Second, testClus) if err != nil { @@ -53,7 +55,6 @@ func TestResize(t *testing.T) { if err != nil { t.Fatal(err) } - time.Sleep(5 * time.Second) testClus, err = k8sutil.GetClusterTPRObject(testF.KubeCli.CoreV1().RESTClient(), testF.KubeNS, testClus.Metadata.Name) if err != nil {