Skip to content
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
4 changes: 2 additions & 2 deletions test/conformance/api/v1/blue_green_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ func TestBlueGreenRoute(t *testing.T) {
// Since we are updating the service the teal domain probe will succeed before our changes
// take effect so we probe the green domain.
t.Log("Probing", greenURL)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
greenURL,
v1test.RetryingRouteInconsistency(spoof.IsStatusOK),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", greenURL, err)
Expand Down
7 changes: 3 additions & 4 deletions test/conformance/api/v1/generatename_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,26 @@ func validateName(generateName, name string) error {
func canServeRequests(t *testing.T, clients *test.Clients, route *v1.Route) error {
t.Logf("Route %s has a domain set in its status", route.Name)
var url *url.URL
err := v1test.WaitForRouteState(
err := v1test.CheckRouteState(
clients.ServingClient,
route.Name,
func(r *v1.Route) (bool, error) {
url = r.Status.URL.URL()
return url.String() != "", nil
},
"RouteDomain",
)
if err != nil {
return fmt.Errorf("route did not get assigned an URL: %w", err)
}

t.Logf("Route %s can serve the expected data at %s", route.Name, url)
_, err = pkgtest.WaitForEndpointState(
_, err = pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
url,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, spoof.MatchesBody(test.HelloWorldText))),
"WaitForEndpointToServeText",
"CheckEndpointToServeText",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/api/v1/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestCustomResourcesLimits(t *testing.T) {
}
endpoint := objects.Route.Status.URL.URL()

_, err = pkgtest.WaitForEndpointState(
_, err = pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/api/v1/revision_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ func TestRevisionTimeout(t *testing.T) {
serviceURL := resources.Service.Status.URL.URL()

t.Log("Probing to force at least one pod", serviceURL)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
serviceURL,
v1test.RetryingRouteInconsistency(spoof.IsOneOfStatusCodes(http.StatusOK, http.StatusGatewayTimeout)),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", serviceURL, err)
Expand Down
9 changes: 4 additions & 5 deletions test/conformance/api/v1/route_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ func assertResourcesUpdatedWhenRevisionIsReady(t *testing.T, clients *test.Clien
// TODO(#1178): Remove "Wait" from all checks below this point.
t.Log("Serves the expected data at the endpoint")

_, err := pkgtest.WaitForEndpointState(
_, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
url,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, pkgtest.EventuallyMatchesBody(expectedText))),
"WaitForEndpointToServeText",
"CheckEndpointToServeText",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS))
if err != nil {
Expand All @@ -72,15 +72,15 @@ func assertResourcesUpdatedWhenRevisionIsReady(t *testing.T, clients *test.Clien
t.Fatalf("The Configuration %s was not updated indicating that the Revision %s was ready: %v", names.Config, names.Revision, err)
}
t.Log("Updates the Route to route traffic to the Revision")
if err := v1test.WaitForRouteState(clients.ServingClient, names.Route, v1test.AllRouteTrafficAtRevision(names), "AllRouteTrafficAtRevision"); err != nil {
if err := v1test.CheckRouteState(clients.ServingClient, names.Route, v1test.AllRouteTrafficAtRevision(names)); err != nil {
t.Fatalf("The Route %s was not updated to route traffic to the Revision %s: %v", names.Route, names.Revision, err)
}
}

func getRouteURL(clients *test.Clients, names test.ResourceNames) (*url.URL, error) {
var url *url.URL

err := v1test.WaitForRouteState(
err := v1test.CheckRouteState(
clients.ServingClient,
names.Route,
func(r *v1.Route) (bool, error) {
Expand All @@ -90,7 +90,6 @@ func getRouteURL(clients *test.Clients, names test.ResourceNames) (*url.URL, err
url = r.Status.URL.URL()
return url != nil, nil
},
"RouteURL",
)

return url, err
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/api/v1/single_threaded_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ func TestSingleConcurrency(t *testing.T) {
// Ready does not actually mean Ready for a Route just yet.
// See https://github.com/knative/serving/issues/1582
t.Log("Probing", url)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
url,
v1test.RetryingRouteInconsistency(spoof.IsStatusOK),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", url, err)
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/api/v1/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func validateDomains(t testing.TB, clients *test.Clients, serviceName string,
// runLatest Service's lifecycle so long as the service is in a "Ready" state.
func validateDataPlane(t testing.TB, clients *test.Clients, names test.ResourceNames, expectedText string) error {
t.Log("Checking that the endpoint vends the expected text:", expectedText)
_, err := pkgTest.WaitForEndpointState(
_, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
5 changes: 3 additions & 2 deletions test/conformance/api/v1/volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ func TestProjectedServiceAccountToken(t *testing.T) {
Service: test.ObjectNameForTest(t),
Image: "hellovolume",
}
test.EnsureTearDown(t, clients, &names)

const tokenPath = "token"
saPath := filepath.Join(filepath.Dir(test.HelloVolumePath), tokenPath)
Expand Down Expand Up @@ -470,13 +471,13 @@ func TestProjectedServiceAccountToken(t *testing.T) {
}
names.URL.Path = path.Join(names.URL.Path, tokenPath)

if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
names.URL,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, isJWT)),
"WaitForEndpointToServeTheToken",
"CheckEndpointToServeTheToken",
test.ServingFlags.ResolvableDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Error(err)
Expand Down
12 changes: 6 additions & 6 deletions test/conformance/api/v1alpha1/domain_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ func TestDomainMapping(t *testing.T) {

endpoint := dm.Status.URL.URL()
t.Log("Probing", endpoint)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
endpoint,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, spoof.MatchesBody(test.PizzaPlanetText1))),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
resolvableCustomDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", endpoint, err)
Expand Down Expand Up @@ -175,13 +175,13 @@ func TestDomainMapping(t *testing.T) {

// Because the second DomainMapping collided with the first, it should not have taken effect.
t.Log("Probing", endpoint)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
endpoint,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, spoof.MatchesBody(test.PizzaPlanetText1))),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
resolvableCustomDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", endpoint, err)
Expand All @@ -208,13 +208,13 @@ func TestDomainMapping(t *testing.T) {

endpoint = altDm.Status.URL.URL()
t.Log("Probing", endpoint)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
endpoint,
v1test.RetryingRouteInconsistency(spoof.MatchesAllOf(spoof.IsStatusOK, spoof.MatchesBody(test.PizzaPlanetText2))),
"WaitForSuccessfulResponse",
"CheckSuccessfulResponse",
resolvableCustomDomain,
test.AddRootCAtoTransport(context.Background(), t.Logf, clients, test.ServingFlags.HTTPS)); err != nil {
t.Fatalf("Error probing %s: %v", endpoint, err)
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/api/v1beta1/domain_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestDomainMapping(t *testing.T) {

endpoint := dm.Status.URL.URL()
t.Log("Probing", endpoint)
if _, err := pkgtest.WaitForEndpointState(
if _, err := pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
4 changes: 2 additions & 2 deletions test/conformance/runtime/readiness_probe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func TestProbeRuntime(t *testing.T) {
// Once the service reports ready we should immediately be able to curl it.
url := resources.Route.Status.URL.URL()
url.Path = "/healthz"
if _, err = pkgtest.WaitForEndpointState(
if _, err = pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down Expand Up @@ -227,7 +227,7 @@ func waitReadyThenStartFailing(t *testing.T, clients *test.Clients, names test.R
t.Log("Wait for initial readiness")
url := resources.Route.Status.URL.URL()
url.Path = "/healthz"
if _, err = pkgtest.WaitForEndpointState(
if _, err = pkgtest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/runtime/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func fetchRuntimeInfo(
return nil, nil, err
}

resp, err := pkgTest.WaitForEndpointState(
resp, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/activator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestActivatorOverload(t *testing.T) {
t.Fatal("Unable to create resources:", err)
}

if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/autoscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func SetupSvc(t *testing.T, class, metric string, target int, targetUtilization
t.Fatalf("Failed to create initial Service: %v: %v", names.Service, err)
}

if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/autoscale_hpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func setupHPASvc(t *testing.T, metric string, target int) *TestContext {
t.Fatalf("Failed to create initial Service: %v: %v", names.Service, err)
}

if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/autotls/auto_tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func TestTLSDisabledWithAnnotation(t *testing.T) {
t.Fatalf("Failed to create initial Service: %v: %v", names.Service, err)
}

if err = v1test.WaitForRouteState(clients.ServingClient, names.Route, routeTLSDisabled, "RouteTLSDisabled"); err != nil {
if err = v1test.CheckRouteState(clients.ServingClient, names.Route, routeTLSDisabled); err != nil {
t.Fatalf("Traffic for route: %s does not have TLS disabled: %v", names.Route, err)
}

if err = v1test.WaitForRouteState(clients.ServingClient, names.Route, routeURLHTTP, "RouteURLIsHTTP"); err != nil {
if err = v1test.CheckRouteState(clients.ServingClient, names.Route, routeURLHTTP); err != nil {
t.Fatalf("Traffic for route: %s is not HTTP: %v", names.Route, err)
}

Expand Down
6 changes: 3 additions & 3 deletions test/e2e/destroypod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestDestroyPodInflight(t *testing.T) {
t.Fatal("Error obtaining Revision's name", err)
}

if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestDestroyPodTimely(t *testing.T) {
}
routeURL := objects.Route.Status.URL.URL()

if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestDestroyPodWithRequests(t *testing.T) {
}
routeURL := objects.Route.Status.URL.URL()

if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/domainmapping/domain_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func TestBYOCertificate(t *testing.T) {
return transport
}

_, err = pkgTest.WaitForEndpointState(ctx,
_, err = pkgTest.CheckEndpointState(ctx,
clients.KubeClient,
t.Logf,
&url.URL{Scheme: "HTTPS", Host: host},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/egress_traffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestEgressTraffic(t *testing.T) {
t.Log("Service URL: " + service.Route.Status.URL.String())

url := service.Route.Status.URL.URL()
if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/emptydir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestEmptyDirVolume(t *testing.T) {
}

url := resources.Route.Status.URL.URL()
if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/grpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ func testGRPC(t *testing.T, f grpcTest, fopts ...rtesting.ServiceOption) {
}
url := resources.Route.Status.URL.URL()

if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/helloworld_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestHelloWorld(t *testing.T) {
}

url := resources.Route.Status.URL.URL()
if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestQueueSideCarResourceLimit(t *testing.T) {
}
url := resources.Route.Status.URL.URL()

if _, err = pkgTest.WaitForEndpointState(
if _, err = pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/http2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestHelloHTTP2WithPortNameH2C(t *testing.T) {
}

url := resources.Route.Status.URL.URL()
if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestHelloHTTP2WithEmptyPortName(t *testing.T) {
}

url := resources.Route.Status.URL.URL()
if _, err := pkgTest.WaitForEndpointState(
if _, err := pkgTest.CheckEndpointState(
context.Background(),
clients.KubeClient,
t.Logf,
Expand Down
Loading