Skip to content

test(e2e): eleven diagnostic reads hardcode their bound, so lowering the read budget does not lower them #3695

Description

hack/e2e-chainsaw/_lib/run-kubernetes.sh exposes COZY_DIAG_READ_TIMEOUT as the budget every bounded diagnostic read is supposed to spend, and cozy_diag_read honours it. Eleven reads elsewhere in the same file do not: they carry timeout -k 5 60, timeout -k 5 20 or timeout -k 5 30 as literals, at lines 515, 521, 539, 598, 664, 702, 705, 764, 811, 870 and 873. Lowering the knob leaves them where they are.

The knob is not decorative. It is validated, documented and overridable precisely so a caller or a test can shrink the diagnostics budget, and a suite that shrinks it gets a block where some reads obey and some do not, with no signal saying which. The failure is silent in the direction that matters: the reads that ignore the knob are the ones that outlive it, so the budget appears to be respected right up to the point where the phase overruns on a read nobody could shorten.

This is not a hypothetical rule looking for a violation. The guard that catches it already exists and has already fired on this file: hack/run-kubernetes-node-join_test.bats lowers the knob after sourcing and asserts that no read still carries the old bound, and it caught exactly this defect in a collector added recently, written as timeout -k 5 20 with a comment claiming the value "matches the block's". It matched only until someone lowered the knob. That collector now takes the knob and forbids a literal beside it in its own test; the eleven reads listed here predate the rule and are not held to it.

The fix is mechanical, replacing each literal with "${COZY_DIAG_READ_GRACE}" and "${COZY_DIAG_READ_TIMEOUT}", but it is not uniform, and that is the part worth care. The three distinct values (20, 30, 60) suggest at least one read was deliberately given more room; whoever does this has to decide per read whether the difference was meaningful or accidental, and record the answer. Collapsing all eleven onto one knob without that pass would trade a silent divergence for a silent equalisation.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    area/testingIssues or PRs related to testing (e2e, bats, unit tests)
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/backlogGeneral backlog priority. Lower than priority/important-longterm
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/testingIssues or PRs related to testing (e2e, bats, unit tests)kind/bugCategorizes issue or PR as related to a bugpriority/backlogGeneral backlog priority. Lower than priority/important-longtermtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions