Skip to content

e2e: a chainsaw assert fails its step on a transient etcd leader change #4720

Closed

Description

A chainsaw assert fails the step when an etcd leader change lands during one of its GETs. It retries only on NotFound. Any other API error ends the poll right away and prints a diff from the last snapshot it held, so the step is red long before its own timeout.

Latest hit: run 36981828596 on #4654, suite vmdisk, step wait-vmdisk-ready. The DataVolume assert has timeout: 5m and failed after 48s, at 10:59:22.900 UTC. Between 10:59:22.894 and 10:59:22.900 all three kube-apiservers log rpctypes.EtcdError, and kube-scheduler, kube-controller-manager and kube-ovn log etcdserver: leader changed. The DataVolume itself was mid-import (PVC Prime created successfully, importer pod scheduling), not stuck.

To recognise it: ASSERT ERROR far short of the assert's timeout, plus status: {} in the diff when the expected key is an expression. Then look for leader changed in the kube-apiserver logs of the cozyreport snapshot in the same second.

Any suite using a declarative assert can get hit, and which one does is down to timing. The imperative side already guards against this with kubectl_wait_retry in hack/e2e-chainsaw/_lib/run-kubernetes.sh. The declarative asserts have no such guard. The fix belongs upstream, in kyverno/chainsaw#2758. Here, bump chainsaw once a release carries it, and until then rerun the failed job when the signature matches.

Activity

  1. lexfrei commented on Oct 9, 2026

    @lexfrei
    ContributorAuthor

    Four more hits today, on four different PRs, all with the same signature. Each assert failed far short of its timeout. In the cozyreport snapshot of each run, host controllers log etcdserver: leader changed a few seconds before the snapshot was taken:

    Run Suite Failed after / timeout leader changed (UTC) Snapshot (UTC)
    37934054820 computeplane 603s / 35m 14:10:24 14:10:28
    37942459915 computeplane 444s / 35m 15:23:23 15:23:31
    37958966090 opensearch 106s / 12m 18:45:54 18:45:58
    37969917036 computeplane 510s / 35m 19:05:34 19:05:39

    I don't have the exact ASSERT ERROR timestamps, because my copies of the job logs stop early. So the match is on the snapshot time, not on the failing GET.

    All three computeplane failures hit the same assert, the one waiting for computeplane-cluster-ingress-nginx to become Ready. My guess is that this assert polls the longest of all (up to 35m while the tenant worker joins), so it has the most chances to catch a leader change. I haven't checked that. I also don't know what triggers the leader changes themselves.

  2. lexfrei commented on Oct 11, 2026

    @lexfrei
    ContributorAuthor

    One more hit, on #4802:

    Run Suite Failed after / timeout leader changed (UTC) ASSERT ERROR (UTC)
    38074878460 computeplane 200s / 35m 19:22:48.83 (two host apiservers) 19:22:48.97
  3. added 2 commits that reference this issue on Oct 12, 2026
    813c618
    cfa9c5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/flakeCategorizes issue or PR as related to a flaky testtriage/needs-triageIndicates an issue needs triage by a maintainer

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions