Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the scale-to-zero checking in conformance. #13025

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions test/conformance/api/shared/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ import (
"net/url"
"strings"
"testing"
"time"

"github.com/google/go-containerregistry/pkg/name"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/util/sets"

"knative.dev/pkg/pool"
Expand All @@ -36,34 +34,13 @@ import (
"knative.dev/serving/test"
)

const scaleToZeroGracePeriod = 30 * time.Second

// DigestResolutionExceptions holds the set of "registry" domains for which
// digest resolution is not required. These "registry" domains are generally
// associated with images that aren't actually published to a registry, but
// side-loaded into the cluster's container daemon via an operation like
// `docker load` or `kind load`.
var DigestResolutionExceptions = sets.NewString("kind.local", "ko.local", "dev.local")

// WaitForScaleToZero will wait for the specified deployment to scale to 0 replicas.
// Will wait up to 6 times the scaleToZeroGracePeriod (30 seconds) before failing.
func WaitForScaleToZero(t testing.TB, deploymentName string, clients *test.Clients) error {
t.Helper()
t.Logf("Waiting for %q to scale to zero", deploymentName)

return pkgTest.WaitForDeploymentState(
context.Background(),
clients.KubeClient,
deploymentName,
func(d *appsv1.Deployment) (bool, error) {
return d.Status.ReadyReplicas == 0, nil
},
"DeploymentIsScaledDown",
test.ServingFlags.TestNamespace,
scaleToZeroGracePeriod*6,
)
}

// ValidateImageDigest validates the image digest.
func ValidateImageDigest(t *testing.T, imageName string, imageDigest string) (bool, error) {
ref, err := name.ParseReference(pkgTest.ImagePath(imageName))
Expand Down
7 changes: 0 additions & 7 deletions test/conformance/runtime/readiness_probe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
pkgtest "knative.dev/pkg/test"
"knative.dev/pkg/test/spoof"
revisionresourcenames "knative.dev/serving/pkg/reconciler/revision/resources/names"
v1opts "knative.dev/serving/pkg/testing/v1"
"knative.dev/serving/test"
"knative.dev/serving/test/conformance/api/shared"
v1test "knative.dev/serving/test/v1"
)

Expand Down Expand Up @@ -146,11 +144,6 @@ func TestProbeRuntime(t *testing.T) {
); err != nil {
t.Fatalf("The endpoint for Route %s at %s didn't return success: %v", names.Route, url, err)
}

// Check if scaling down works even if access from liveness probe exists.
if err := shared.WaitForScaleToZero(t, revisionresourcenames.Deployment(resources.Revision), clients); err != nil {
t.Fatal("Could not scale to zero:", err)
}
})
}
}
Expand Down