Skip to content

fix(test): repair flap-state call arity that broke main's go vet (merge-skew) - #320

Merged
thc1006 merged 1 commit into
mainfrom
hotfix/storeflapstate-test-arity
Jul 31, 2026
Merged

fix(test): repair flap-state call arity that broke main's go vet (merge-skew)#320
thc1006 merged 1 commit into
mainfrom
hotfix/storeflapstate-test-arity

Conversation

@thc1006

@thc1006 thc1006 commented Jul 31, 2026

Copy link
Copy Markdown
Owner

main is currently red — this unblocks it

go vet ./... fails on main, so every open PR's Unit + envtest, Race detector, and E2E on Kind (all of which compile the test package) go red regardless of the PR's own content:

vet: internal/controller/ntnslice_satread_test.go:189:3: not enough arguments in call to r.storeFlapState
  have (ObjectKey, UID, AntiFlapState)  want (NamespacedName, UID, int64, AntiFlapState)

Root cause — a merge-skew

storeFlapState / loadFlapState gained a generation int64 parameter (for generation-scoped anti-flap staleness), and the callers in that PR were updated. But the telemetry-gap coverage tests (#292, ntnslice_satread_test.go) were branched off an older main with the old signatures and merged with the stale 3-/2-arg calls. Each PR was green alone; merged main doesn't compile its tests. (go build ./... doesn't catch it — it skips _test.go; only go vet/go test compile them.)

Fix

Pass nsObj.Generation at all four stale call sites (two storeFlapState, two loadFlapState), matching the store/load generation contract and the production callers (ns.Generation). Seeding and loading with the same generation keeps the anti-flap state honored, which is what those tests rely on.

Verification

go vet ./... clean; full internal/controller envtest suite green (21.9s); gofmt clean.

Merge this before the other open PRs — their CI will keep failing until main's tests compile again.

…merge-skew)

storeFlapState/loadFlapState gained a `generation int64` param, but the telemetry-gap
tests (#292) merged with the old 3-/2-arg calls, so `go vet ./...` — and every PR's
Unit/Race/E2E, which all compile the test package — fails on main. Pass nsObj.Generation
at all four call sites, matching the store/load generation-staleness contract and the
production callers (ns.Generation). go vet clean; full controller suite green.

This is why several open PRs show all-red CI: they merge a main whose tests do not compile.
@thc1006
thc1006 merged commit 69407a6 into main Jul 31, 2026
5 checks passed
@thc1006
thc1006 deleted the hotfix/storeflapstate-test-arity branch July 31, 2026 01:23
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