Files
cozystack/packages
Myasnikov Daniil 867e89097a test(e2e): shrink the tenant-Kubernetes lane to fit the runner
Throwaway experiment branch. Not for merge.

The e2e runner has 16 physical cores. Measured across three archived runs
(identical every time) the platform requested 16810m of pod CPU, so it asked
for more than the machine has before a single tenant worker booted, while the
three sandbox nodes ran -smp 8 for 24 vCPU threads against those 16 cores --
1.5x oversubscribed. A fixed-work microbenchmark on the runner shows 16
threads on 16 cores scaling perfectly (2779ms vs 2787ms solo) and 24 threads
degrading to a 2796/4219/5077ms min/mean/max spread, which is the shape the
tenant workers show: every worker in a failing run spends 220-400s inside
20-86s gaps between adjacent kernel-init printks and never reaches a healthy
kubelet, while every worker in a passing run finishes kernel init in 20-44s
and has kubelet healthy by 50-146s.

This branch tests whether that oversubscription is the cause, by taking the
lane back under 1.0x:

  -smp 8 -> -smp 4, so 12 vCPU threads on 16 cores (0.75x, the ratio the
  runner had before its cores were halved) instead of 24 (1.5x).

-smp 4 only schedules if the requests shrink with it, so the workload the
tenant-Kubernetes suites never touch is removed:

  - The root Tenant runs with ingress, monitoring and seaweedfs off. Those
    three flags -- not the package set -- are what created ~5.3 CPU of
    tenant-root workload: the VictoriaMetrics/VictoriaLogs cluster, Grafana
    and its CNPG database, Alerta, the SeaweedFS chain, the NGINX controller.
    etcd stays on because it is Kamaji's datastore. The *-application
    packages stay installed, because cozystack.tenant-application dependsOn
    all three and disabling the packages would wedge the Tenant CR itself.
  - bundles.paas and bundles.naas are off, removing the database operators
    and their app definitions (~1.1 CPU).
  - disabledPackages drops velero, monitoring-agents, goldpinger and
    backup-controller (~0.7 CPU).
  - The Keycloak OIDC test is gone, which leaves authentication.oidc.enabled
    off, which is the only thing that emits cozystack.keycloak and
    cozystack.keycloak-operator (~0.25 CPU).

Two packages stay despite being unused here, because a dependsOn edge makes
them load-bearing: cozystack.vertical-pod-autoscaler (etcd-operator's default
variant dependsOn it unconditionally) and every *-application named above.

Requests fall from 16810m to ~9.5 CPU against 11850m of allocatable at
-smp 4, about 80% packed.

Because the app definitions are gone, the suites that install them cannot run,
so CHAINSAW_SUITES is pinned to the two tenant-Kubernetes suites rather than
selected -- editing hack/*.bats escalates Test Impact Analysis to the full
suite, and most of the full suite would now fail on a missing
ApplicationDefinition rather than on anything being measured.

A preflight test reads each node's Allocated-resources CPU and fails if any
node is at 90% or more. Insufficient cpu is a verdict on requests versus
allocatable, and every previous encounter with it surfaced as "the tenant
worker never became Ready" 29 minutes later -- the most expensive possible
way to learn that a number did not fit.

Three helm-unittest suites assert the rendered package set: paas and naas
emit nothing, the four disabled packages and both keycloak packages are
absent, and the iaas path plus the dependsOn blockers survive. Negative
assertions use `containsDocument` with `any: true` alongside `not: true`,
which was checked against a package known to be present and does fail there;
the `not: true`-without-`any` form used in tests/bundles_velero_default_test.yaml
passes even when the document IS rendered, so that existing opt-out guard is
currently vacuous. Not fixed here to keep this branch to one subject.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
2026-08-22 19:03:52 +05:00
..