serving
serving copied to clipboard
Adds e2e test for activation-scale
Fixes #11308
Proposed Changes
-
Adds e2e test for activation-scale (merged in #13136 )
-
Test uses
initial-scale: 0to avoid having to deploy a service and wait for it to scale to zero -
Since
allow-zero-initial-scaleis not enabled by default, test can't run with all the other e2e tests. So created a separate directory and run the test with the initial-scale-zero e2e test -
Exposed a few helper functions from
test/e2e/autoscale.gofor use in the test -
Also, removed an unnecessary log message from the resource quota test (that slipped in by mistake, was using it for local debugging)
/assign @dprotaso
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: psschwei
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~test/OWNERS~~ [psschwei]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Codecov Report
Patch and project coverage have no change.
Comparison is base (
2fc2a12) 86.23% compared to head (1dcf2be) 86.23%.
Additional details and impacted files
@@ Coverage Diff @@
## main #13197 +/- ##
=======================================
Coverage 86.23% 86.23%
=======================================
Files 197 197
Lines 14774 14774
=======================================
Hits 12740 12740
Misses 1733 1733
Partials 301 301
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.
/remove-lifecycle stale
/retest
/retest
nil pointer
=== CONT TestActivationScale
stream.go:305: D 15:58:33.214 controller-55bff84dc-ft4wr [knative.dev.serving.pkg.reconciler.labeler.Reconciler] [serving-tests/activation-scale-qvdpjkqk] Labeler V2 applying patch to "activation-scale-qvdpjkqk-00001". patch: map["metadata":map["annotations":map["serving.knative.dev/routes":<nil> "serving.knative.dev/routingStateModified":"2023-01-13T15:58:33Z"] "labels":map["serving.knative.dev/routingState":"reserve"]]]
--- FAIL: TestActivationScale (62.23s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x25416cd]
goroutine 1003 [running]:
testing.tRunner.func1.2({0x27515e0, 0x3b7d1d0})
/root/.gvm/gos/go1.19.4/src/testing/testing.go:1396 +0x372
testing.tRunner.func1()
/root/.gvm/gos/go1.19.4/src/testing/testing.go:1399 +0x5f0
panic({0x27515e0, 0x3b7d1d0})
/root/.gvm/gos/go1.19.4/src/runtime/panic.go:890 +0x262
knative.dev/serving/test/e2e.TestActivationScale(0xc000e4aea0)
/home/prow/go/src/knative.dev/serving/test/e2e/autoscale_test.go:346 +0x80d
testing.tRunner(0xc000e4aea0, 0x2aa9ce0)
/root/.gvm/gos/go1.19.4/src/testing/testing.go:1446 +0x217
created by testing.(*T).Run
/root/.gvm/gos/go1.19.4/src/testing/testing.go:1493 +0x75e
}
weird, it passes locally...
$ go test -tags=e2e ./test/e2e -run ActivationScale -count 1 -race
ok knative.dev/serving/test/e2e 41.077s
there's a lot of queuing on the CI runs (that doesn't happen locally), but not sure if that's related to the failures...
/retest
Ok, think I've narrowed down what's happening here...
In the test, I'm doing a simple http.Get("http://" + resources.Route.Status.URL.URL().Hostname()) to ping the service, and the hostname is equal to activation-scale-iubdztsd.serving-tests.example.com. However, the test is failing with this error:
Get "http://activation-scale-iubdztsd.serving-tests.example.com/": dial tcp: lookup activation-scale-iubdztsd.serving-tests.example.com: no such host
When I checked the status of the ksvc, I noticed that status.address.url is ...cluster.local, whereas status.url is ...example.com (that only happens, I think, when DNS hasn't been configured):
Status:
Address:
URL: http://activation-scale-iubdztsd.serving-tests.svc.c4088147530.local/
Conditions:
Last Transition Time: 2023-02-03T22:01:22Z
Status: True
Type: ConfigurationsReady
Last Transition Time: 2023-02-03T22:01:22Z
Status: True
Type: Ready
Last Transition Time: 2023-02-03T22:01:22Z
Status: True
Type: RoutesReady
Latest Created Revision Name: activation-scale-iubdztsd-00001
Latest Ready Revision Name: activation-scale-iubdztsd-00001
Observed Generation: 1
Traffic:
Latest Revision: true
Percent: 100
Revision Name: activation-scale-iubdztsd-00001
URL: http://activation-scale-iubdztsd.serving-tests.example.com/
The issue seems to be with the config-domain configmap, where the domain is listed as: example.com:
When running the magic DNS job locally, the domain would instead be: example.com: "" (the quotes being the key thing that's missing).
So it seems like I either need to:
- run the magic DNS job to be able to use
http.Get()or - look for another way to send a request to the service
Tests are passing now :partying_face:
@dprotaso this one's ready for another look
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: dprotaso, psschwei
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [dprotaso,psschwei]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment