serving icon indicating copy to clipboard operation
serving copied to clipboard

Adds e2e test for activation-scale

Open psschwei opened this issue 3 years ago • 2 comments

Fixes #11308

Proposed Changes

  • Adds e2e test for activation-scale (merged in #13136 )

  • Test uses initial-scale: 0 to avoid having to deploy a service and wait for it to scale to zero

  • Since allow-zero-initial-scale is 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.go for 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

psschwei avatar Aug 09 '22 18:08 psschwei

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

knative-prow[bot] avatar Aug 09 '22 18:08 knative-prow[bot]

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.

codecov[bot] avatar Aug 09 '22 18:08 codecov[bot]

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.

github-actions[bot] avatar Nov 10 '22 01:11 github-actions[bot]

/remove-lifecycle stale

psschwei avatar Nov 10 '22 01:11 psschwei

/retest

psschwei avatar Jan 03 '23 20:01 psschwei

/retest

psschwei avatar Jan 13 '23 14:01 psschwei

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
}

dprotaso avatar Jan 13 '23 20:01 dprotaso

weird, it passes locally...

$ go test -tags=e2e ./test/e2e -run ActivationScale -count 1 -race
ok      knative.dev/serving/test/e2e    41.077s

psschwei avatar Jan 18 '23 20:01 psschwei

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...

psschwei avatar Jan 18 '23 22:01 psschwei

/retest

psschwei avatar Feb 03 '23 14:02 psschwei

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

psschwei avatar Feb 03 '23 22:02 psschwei

Tests are passing now :partying_face:

@dprotaso this one's ready for another look

psschwei avatar Feb 10 '23 21:02 psschwei

/lgtm /approve

dprotaso avatar Mar 06 '23 21:03 dprotaso

[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

Needs approval from an approver in each of these files:
  • ~~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

knative-prow[bot] avatar Mar 06 '23 21:03 knative-prow[bot]