Skip to content

Commit

Permalink
test(packagemanifests): add wait for package-server to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
njhale committed Dec 10, 2018
1 parent 48f7a80 commit d519125
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/e2e/packagemanifest_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package e2e

import (
"testing"
"time"

"github.com/coreos/go-semver/semver"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit d519125

Please sign in to comment.