Skip to content

test(e2e): data-plane capture still overwrites some files and hides failed reads #4629

Open

Description

The e2e data-plane capture (hack/e2e-capture-dataplane.sh) still has a few output and input defects that the budget and filename work did not touch. Each is small; together they decide whether a second capture run leaves a readable artifact.

Files that lose or blur an earlier run:

  • ovn-lflows.txt is overwritten on every run.
  • node-<node>.txt is appended to without the run separator the other per-run files use.
  • lb-speaker-logs.txt is truncated on every run.

Reads that hide what happened:

  • The speaker-log read discards stderr and writes no note when it fails.
  • ovs_iface_for falls back to the geneve interface without saying so.
  • COZY_DATAPLANE_READ_TIMEOUT and COZY_DATAPLANE_LIST_TIMEOUT are not validated. A non-numeric value surfaces as "kubectl exited 125" although kubectl never ran.

Two comments narrate history instead of the reason: the "merge-base behaviour" note in lb_capture_decision and "Five of them used to" in capture_lb_datapath.

Fix shape: append with the shared run separator everywhere, write a note on every failed or fallen-back read, validate the timeout knobs the way the budget knobs are validated, and restate the two comments as reasons.

Activity

  1. lexfrei commented on Oct 1, 2026

    @lexfrei
    ContributorAuthor

    Update after #4640. That PR fixed the items whose lines it already changed: node-<node>.txt now gets the run separator, a failed speaker-log read writes a note, ovs_iface_for notes its geneve fallback, and COZY_DATAPLANE_READ_TIMEOUT and COZY_DATAPLANE_LIST_TIMEOUT are validated. Still open here: ovn-lflows.txt and lb-speaker-logs.txt are overwritten or truncated each run, and the two history comments.

    Review of #4640 turned up four more of the same kind, all on main before that PR:

    • COZY_DATAPLANE_MAX_PODS and COZY_DATAPLANE_MAX_LBS are not validated. A non-numeric value makes the -gt test fail, so the pod cap never fires and lb_budget_ok reports "cap reached" on the first broken LoadBalancer.
    • capture_pod_dataplane ignores its lookup statuses. When a failed lookup is served from the memo, the conntrack and OVS blocks are skipped with no note.
    • dp_read_outcome cuts kubectl stderr to 300 characters in capture-notes.txt. On a throttled apiserver the throttling lines come first and the real reason is cut off.
    • The collector paragraph in docs/agents/e2e-testing.md says why a read produced nothing goes to capture-notes.txt. Exec-block errors and the Ready-block reads report inside the block instead.
  2. lexfrei commented on Oct 2, 2026

    @lexfrei
    ContributorAuthor

    One more of the same kind, found during the last #4640 review: at around lines 1699 and 1710 of hack/e2e-capture-dataplane.sh, when the cni-server lookup failure is served from the lookup cache, the announcer or endpoint tcpdump is skipped with no note and no file, the same silent skip the pod captures have after a cached failed lookup.

  3. lexfrei commented on Oct 5, 2026

    @lexfrei
    ContributorAuthor

    Three more from the review of #4640, checked on main at 2ddd55c.

    • The budget knobs are checked for digits only, so a value too big for shell arithmetic gets through. Under dash a 19- or 20-digit COZY_DATAPLANE_BUDGET aborts with Illegal number, and under bash a 19-digit one wraps DP_DEADLINE negative, so every call is refused (comment).
    • dp_note_spent checks the notes file and then appends. The two background tcpdump execs in capture_lb_datapath run dp_run at the same time, so if the deadline passes in that window the section note can be written twice. Only cosmetic, dp_walk_end still matches it (comment).
    • The speaker-log walk eats into the LoadBalancer reserve. It runs one kubectl logs per MetalLB speaker, up to 15s each and with no cap on the count, before the first LB probe. On a slow apiserver with many nodes that can use up the 90s reserve before any LB is probed. A cap on the walk would bound it (comment).
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 bugtriage/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