knative / knative/serving

Autoscaler tests should be runnable under chaos

Open
#10,936 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/autoscale kind/feature triage/accepted
Dominant language
Go
Stars
6.1k
Forks
1.2k
Avg merge
2d 7h
Merged PRs (30d)
2

Description

/area autoscale

Describe the feature

The autoscaler tests should be run with chaos duck enabled.

For now we disabled this because it causes flakes (see https://github.com/knative/serving/pull/10928), but in reality pods do crash and get upgraded in real systems and we should (a) have tests for this, (b) actually be resilient to this and as far as possible maintain correct behaviour.

Ideally, this will be achieved by making autoscaler HA (which should largely be done via #2930), such that guarantees can be kept even when autoscaler restarts. In some cases we may need to relax test guarantees to account for permitted/expected behaviour under chaos. In the worst case we may need to move some tests to a suite which does not run with chaos enabled (ideally not, though).

Here is a Potential Plan (will update/spin out issues based on discussion in this issue if folks have better ideas):

  • Stop the bleeding: turn off chaos in main suite so we know any new flakes are not due to this. https://github.com/knative/serving/pull/10928
  • Investigate existing flakes in test/ha suite (eg https://prow.knative.dev/view/gcs/knative-prow/logs/ci-knative-serving-nightly-release/1368491671720824832 from nightlies)
  • Check the most flaky tests - TestAutoscaleSustaining, TestRPSBasedAutoscaleUpCountPods - to see why they flake. Do we expect flakes even with HA enabled given our current contract? Fix tests if possible, or fix HA if we think we can fix it with better HA.
  • Run variants of above tests in test/ha suite where we can explicitly kill things in the test rather than relying on chaos to do it. This should establish whether the tests will work under chaos.
  • Enable Chaos again!
  • If above step is not possible (eg if there are guarantees we want to test even though we do not expect them to work under chaos), create separate suite for these tests only. Ideally we do not do this because we've fixed everything to be actually HA or relaxed tests to reflect real guarantees.
  • Enable Chaos again!

/assign @markusthoemmes @vagababov @yanweiguo for thoughts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing flakes in the test/ha suite, especially TestAutoscaleSustaining and TestRPSBasedAutoscaleUpCountPods, and read PR 10928 for the current chaos-disabled setup. Compare explicit failure variants with the expected HA behavior from #2930. Done means the autoscaler tests run reliably with chaos enabled, or the affected tests are separated with their guarantees documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
distributed-systems, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.