Skip to content

test(xtcp): unregister the test destination so -count=N works - #303

Merged
randomizedcoder merged 1 commit into
mainfrom
test/count2-registry
Nov 14, 2026
Merged

randomizedcoder merged 1 commit into
mainfrom
test/count2-registry

Conversation

@randomizedcoder

Copy link
Copy Markdown
Owner
  • TestRegisterDestination_lookupFound registered a scheme and never removed it; go test -count=2 ./pkg/xtcp panicked on the second run in RegisterDestination's duplicate guard.
  • The guard stays (it catches two files claiming one dest_ tag); the test now unregisters in t.Cleanup.
  • Table-driven: lookup found (P), duplicate panics (N), re-register after cleanup (C).
  • go test ./... -count=2 passes; golangci (default, comprehensive), lint-baseline, gofmt clean.

🤖 Generated with Claude Code

TestRegisterDestination_lookupFound registered a scheme and never removed
it, so a second run in the same process (go test -count=2) hit
RegisterDestination's duplicate-registration panic. The panic is the
intended guard against two files claiming one dest_ build tag; the test
now removes its registration in t.Cleanup. Table-driven, with rows for the
lookup, the duplicate panic, and re-registration after cleanup.
go test ./... -count=2 now passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@randomizedcoder
randomizedcoder merged commit f155ea4 into main Nov 14, 2026
1 check 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