From d51912537dee7b4f7a0bd9beeb1628d75aee9077 Mon Sep 17 00:00:00 2001 From: njhale Date: Sun, 9 Dec 2018 19:20:15 -0500 Subject: [PATCH] test(packagemanifests): add wait for package-server to be ready --- test/e2e/packagemanifest_e2e_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/e2e/packagemanifest_e2e_test.go b/test/e2e/packagemanifest_e2e_test.go index 4ca228eaf75..f4c83428c1d 100644 --- a/test/e2e/packagemanifest_e2e_test.go +++ b/test/e2e/packagemanifest_e2e_test.go @@ -2,6 +2,7 @@ package e2e import ( "testing" + "time" "github.com/coreos/go-semver/semver" "github.com/stretchr/testify/require" @@ -83,6 +84,17 @@ func TestPackageManifestLoading(t *testing.T) { DefaultChannel: stableChannel, } + // Wait for package-server to be ready + err := wait.Poll(pollInterval, 1*time.Minute, func() (bool, error) { + t.Logf("Polling package-server...") + _, err := pmc.PackagemanifestV1alpha1().PackageManifests(testNamespace).List(metav1.ListOptions{}) + if err == nil { + return true, nil + } + return false, nil + }) + require.NoError(t, err, "package-server not available") + watcher, err := pmc.PackagemanifestV1alpha1().PackageManifests(testNamespace).Watch(metav1.ListOptions{}) require.NoError(t, err) defer watcher.Stop()