Skip to content

fix(watch): the test watch sparkline keeps the last 40 polls - #398

Merged
bmscomp merged 1 commit into
mainfrom
fix/watch-sparkline-keeps-40-points
Oct 18, 2026
Merged

bmscomp merged 1 commit into
mainfrom
fix/watch-sparkline-keeps-40-points

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Item 1.12 of the CLI performance and stability plan (finding F19, the sparkline part). Independent of the other Wave 1 PRs.

Why

The TUI path of kates test watch and kates test create --wait appends every poll's peak throughput to the sparkline history and never drops one (cli/cmd/watch.go:190 on main, 6f4cf61). An hour into a run the sparkline was 1,823 columns wide (the plan's measurement), and the renderer cuts off the live number printed after it. cluster watch already caps its history at 30.

Changes

cli/cmd/watch.go: the history keeps the last 40 polls (sparklinePoints). The rest of F19, the pollers that overlap themselves and the port-forward repair that runs inside Update, is items 6.2 and 6.3.

Tests

Added TestPollModel_SparklineKeepsTheLastPoints: 100 RUNNING polls with throughputs 0 to 99 leave 40 points, 60 to 99. On main's watch.go all 100 stay.

Run locally, passing:

  • cd cli && go test ./..., go test -race ./cmd, go vet ./....
  • golangci-lint run --new-from-rev=origin/main ./...: 0 issues.
  • scripts/check-cli-style.sh and scripts/check-cli-compat.sh: OK.
  • The backend suite, which cli/** triggers (Build & Test): this PR touches nothing under kates/. ./mvnw test on main's kates/ tree ran 1,254 tests with 0 failures and 0 errors, once for all of Wave 1.

Skipped locally: govulncheck, as go.mod is unchanged.

CI only: ./mvnw verify with the *IT tests, the Kind and Docker jobs, CodeQL and Trivy.

The TUI path of `kates test watch` and `create --wait` appended every poll's
throughput to the sparkline history and never dropped one. An hour into a
run the sparkline was 1,823 columns wide, and the renderer cut off the live
number printed after it.

The history keeps the last 40 polls (sparklinePoints).
TestPollModel_SparklineKeepsTheLastPoints feeds 100 polls and gets the last
40, oldest first.
@bmscomp
bmscomp merged commit b896b6c into main Oct 18, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant