Skip to content

docs(tests): correct five stale claims in the e2e capture tooling - #3662

Merged
Aleksei Sviridkin (lexfrei) merged 4 commits into
mainfrom
fix/e2e-docs-and-comment-tidyup
Aug 9, 2026
Merged

docs(tests): correct five stale claims in the e2e capture tooling#3662
Aleksei Sviridkin (lexfrei) merged 4 commits into
mainfrom
fix/e2e-docs-and-comment-tidyup

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Five things in the e2e tooling said something the code no longer does, or did not say it at all. All five are prose; no executable line changes.

docs/agents/e2e-testing.md section 8 described two of the three on-failure capture legs. The missing one is hack/e2e-capture-dataplane.sh, the only leg that reads forwarding state off the node rather than object state, and the only one whose two callers bound it differently, 600s from the BATS runner and 300s from the Chainsaw catch. That split is what decides whether something added to it fits, so a contributor who reads the document and not the script sizes a change against the wrong budget. Its notes contract is described with the carve-out the script declares itself: the two EndpointSlice reads in the LoadBalancer path report nothing either way, so a <none> backend line there is the one place a reader still cannot tell an endpointless Service from a read that never answered.

The same section said the runner's captures serve "the BATS tests" in two places. They serve the e2e ones. The runner keys on an e2e- prefix, on the suite's own filename or on its parent directory, because all three legs read cluster state and a unit runner has kubectl on PATH with no cluster behind it. The legs are not gated alike either, so the sentence says which fired where: two key on kubectl, and the snapshot leg keys on crust-gather being installed, which on a unit runner it usually is not.

Two numbers in the capture-gate rationale in hack/cozytest.sh no longer described the code. The snapshot leg's cost was given as 360s, the deadline passed to timeout; the leg is invoked as timeout -k 30 360, so the trap waits out 390s, which is what the comment forty lines below and the op-budget arithmetic in .chainsaw.yaml already said. And the data-plane leg was still described as having no bound on its first pod list, and billed at the full 600s on that basis, after that read was given a 28s ceiling.

Two files enumerated the BATS suites and both stopped one short. The global catch in hack/e2e-chainsaw/.chainsaw.yaml said the runner it names as its analog "only covers the BATS install/openapi tests", and hack/e2e-chainsaw/README.md named the same two files. Both miss hack/e2e-prepare-cluster.bats, which packages/core/testing/Makefile drives through that runner, and which is the suite whose failures leave the sandbox in the state hardest to reconstruct afterwards. docs/agents/e2e-testing.md already listed all three, so the tree disagreed with itself depending on which file you opened.

A comment in hack/e2e-install-cozystack.bats pointed at hack/e2e-apps/run-kubernetes.sh, which does not exist; that directory holds two monitoring suites and no runner. The readiness gate it means is the rollout status wait in hack/e2e-chainsaw/_lib/talos-image-cache.sh, along with both fallbacks to the public factory.

relates to #3626 and #3642

Screenshots

Downstream repositories

Release note

NONE

Section 8 described two of the three on-failure capture legs and not
the third, so the collector that reads forwarding state off the node
was absent from the one document that tells a contributor what
diagnostics exist. It is also the leg whose two callers disagree about
its budget, 600s from the BATS runner and 300s from the Chainsaw
catch, which is what decides whether something added to it fits.

Its notes contract is described with the carve-out the script itself
declares: the two EndpointSlice reads in the LoadBalancer path report
nothing either way, so a <none> backend line there is the one place a
reader still cannot tell an endpointless Service from a read that
never answered. Stating the contract without it would have promised
the distinction on the path this collector exists to diagnose.

The prose also still said the runner's captures serve "the BATS
tests". They serve the e2e ones: the runner keys on an e2e- prefix,
on the suite's filename or on its parent directory, because all three
legs read cluster state and a unit runner has kubectl on PATH with no
cluster behind it. Said once where the captures are introduced, and
the two phrases that over-claimed now name the e2e suites.

The legs are not gated alike, so the sentence says which fired where:
two key on kubectl, and the snapshot leg keys on crust-gather being
installed, which on a unit runner it usually is not.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Two numbers in this comment block no longer described the code.

The snapshot leg's cost was given as 360s, the deadline passed to
timeout. The leg is invoked as `timeout -k 30 360`, so a hung
crust-gather is signalled at 360s and killed at 390s, and the trap
waits out the later one. The comment 40 lines below already said 390s,
as does the op-budget arithmetic in .chainsaw.yaml; the three now
agree, and the number names the grace it includes, because the
data-plane leg beside it is quoted at its bare deadline.

The data-plane leg was still described as having no bound on its first
pod list, and billed at the full 600s on that basis. Its reads carry
their own ceilings now, 28s for a list and 20s for a single read, so
the leg returns in tens of seconds and the paragraph's bottom line
overstated the bill it exists to justify.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The note explaining that image-cache readiness is gated at point of
use pointed into hack/e2e-apps/, which holds two monitoring suites and
no runner. The readiness gate it means is the rollout status wait in
hack/e2e-chainsaw/_lib/talos-image-cache.sh, along with both fallbacks
to the public factory; run-kubernetes.sh only calls it. Naming the
caller would have left the reader one hop short of the code.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@github-actions github-actions Bot added area/testing Issues or PRs related to testing (e2e, bats, unit tests) kind/documentation Categorizes issue or PR as related to documentation size/S This PR changes 10-29 lines, ignoring generated files labels Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes update E2E failure-diagnostics guidance, document bounded capture timing and expanded Chainsaw coverage, and point Talos image cache readiness checks to the Chainsaw helper.

Changes

E2E diagnostics and readiness

Layer / File(s) Summary
Failure diagnostics and timing guidance
docs/agents/e2e-testing.md, hack/cozytest.sh, hack/e2e-chainsaw/.chainsaw.yaml, hack/e2e-chainsaw/README.md
The documentation and script comments describe E2E-only Kubernetes collectors, data-plane capture, bounded reads, crust-gather timing, and BATS and Chainsaw coverage.
Talos image cache readiness reference
hack/e2e-install-cozystack.bats
The readiness gate now references hack/e2e-chainsaw/_lib/talos-image-cache.sh and keeps the public Talos factory fallback.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: myasnikovdaniil

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the documentation and comment updates that correct stale claims in the end-to-end testing capture tooling.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/e2e-docs-and-comment-tidyup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/M This PR changes 30-99 lines, ignoring generated files and removed size/S This PR changes 10-29 lines, ignoring generated files labels Aug 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@hack/e2e-install-cozystack.bats`:
- Around line 46-48: Update the comment near the talos image cache reference to
document both fallback gates: rollout failure and failure of the tenant-scoped
Service probe to return HTTP 206. Clarify that the deployment may be Available
yet still fall back to the public factory when the readiness probe cannot reach
the mirror.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f147c192-3e01-44a4-a0e1-9257d95f0ebb

📥 Commits

Reviewing files that changed from the base of the PR and between d956536 and 7afa76b.

📒 Files selected for processing (3)
  • docs/agents/e2e-testing.md
  • hack/cozytest.sh
  • hack/e2e-install-cozystack.bats

Comment on lines +46 to +48
# at point-of-use in hack/e2e-chainsaw/_lib/talos-image-cache.sh, called from
# run-kubernetes.sh, which falls back to the public factory if the mirror never
# becomes Available, so this can only help.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document both mirror readiness gates.

The referenced helper falls back to the public factory not only when the rollout fails, but also when the tenant-scoped probe cannot reach the Service with HTTP 206. An Available deployment can therefore still use the public factory.

Proposed wording
-  # run-kubernetes.sh, which falls back to the public factory if the mirror never
-  # becomes Available, so this can only help.
+  # run-kubernetes.sh, which falls back to the public factory if the mirror
+  # rollout or tenant-scoped HTTP 206 reachability check fails, so this can
+  # only help.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# at point-of-use in hack/e2e-chainsaw/_lib/talos-image-cache.sh, called from
# run-kubernetes.sh, which falls back to the public factory if the mirror never
# becomes Available, so this can only help.
# at point-of-use in hack/e2e-chainsaw/_lib/talos-image-cache.sh, called from
# run-kubernetes.sh, which falls back to the public factory if the mirror
# rollout or tenant-scoped HTTP 206 reachability check fails, so this can
# only help.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/e2e-install-cozystack.bats` around lines 46 - 48, Update the comment
near the talos image cache reference to document both fallback gates: rollout
failure and failure of the tenant-scoped Service probe to return HTTP 206.
Clarify that the deployment may be Available yet still fall back to the public
factory when the readiness probe cannot reach the mirror.

Two files enumerated the BATS suites and both stopped one short.

The global catch in .chainsaw.yaml describes itself as the Chainsaw
analog of the EXIT-trap host snapshot in hack/cozytest.sh, and said
that runner "only covers the BATS install/openapi tests". The
README said cluster bootstrap and the OpenAPI checks remain BATS and
named only two files. Both miss e2e-prepare-cluster.bats, which
packages/core/testing/Makefile drives through the same runner, and
which is the suite whose failures leave the sandbox in the state
hardest to reconstruct afterwards.

docs/agents/e2e-testing.md already listed all three, so the count was
answerable from the tree; it just disagreed with itself depending on
which file you opened.

The .chainsaw.yaml paragraph is reflowed because the correction is
longer than the line it replaces; no other wording changed.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei
Aleksei Sviridkin (lexfrei) force-pushed the fix/e2e-docs-and-comment-tidyup branch from aaa2610 to b11066e Compare August 8, 2026 08:49
@lexfrei Aleksei Sviridkin (lexfrei) changed the title docs(tests): correct four stale claims in the e2e capture tooling docs(tests): correct five stale claims in the e2e capture tooling Aug 8, 2026
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 86fb92a into main Aug 9, 2026
17 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the fix/e2e-docs-and-comment-tidyup branch August 9, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Issues or PRs related to testing (e2e, bats, unit tests) kind/documentation Categorizes issue or PR as related to documentation size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant