headscale/hscontrol/mapper
Kristoffer Dalby 8e26651f2c mapper/batcher: add regression tests for timer leak and Close lifecycle
Add four unit tests guarding fixes introduced in recent commits:

- TestConnectionEntry_SendFastPath_TimerStopped: verifies the
  time.NewTimer fix (H1) does not leak goroutines after many
  fast-path sends on a buffered channel.

- TestBatcher_CloseWaitsForWorkers: verifies Close() blocks until all
  worker goroutines exit (H3), preventing sends on torn-down channels.

- TestBatcher_CloseThenStartIsNoop: verifies the one-shot lifecycle
  contract; Start() after Close() must not spawn new goroutines.

- TestBatcher_CloseStopsTicker: verifies Close() stops the internal
  ticker to prevent resource leaks.

Updates #2545
2026-03-14 02:52:28 -07:00
..
batcher.go mapper/batcher: reduce hot-path log verbosity 2026-03-14 02:52:28 -07:00
batcher_bench_test.go mapper: remove Batcher interface, rename to Batcher struct 2026-03-14 02:52:28 -07:00
batcher_concurrency_test.go mapper: remove Batcher interface, rename to Batcher struct 2026-03-14 02:52:28 -07:00
batcher_scale_bench_test.go mapper/batcher: add scale benchmarks 2026-03-14 02:52:28 -07:00
batcher_test.go mapper: remove Batcher interface, rename to Batcher struct 2026-03-14 02:52:28 -07:00
batcher_unit_test.go mapper/batcher: add regression tests for timer leak and Close lifecycle 2026-03-14 02:52:28 -07:00
builder.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
builder_test.go all: fix golangci-lint issues (#3064) 2026-02-06 21:45:32 +01:00
mapper.go mapper: remove Batcher interface, rename to Batcher struct 2026-03-14 02:52:28 -07:00
mapper_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00
tail_test.go all: upgrade to Go 1.26rc2 and modernize codebase 2026-02-08 12:35:23 +01:00