From 8637a02ce300e88c918cf4a925e3fa3b1f02348c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ros=C5=82aniec?=
Date: Thu, 3 Sep 2026 15:08:12 +0000
Subject: [PATCH] fix(net/local): bound the release-boundary settle drain in
TestReleaseBroadcastChannel
The settle-window drain added to absorb the expected single straggler
tick discarded its count unchecked, so a genuine regression where the
ticker fires more than once after release would only be caught by the
second, stricter window - not at the settle step itself, where it's
easier to diagnose. Assert the settle window sees at most one tick.
---
pkg/net/local/broadcast_channel_manager_test.go | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pkg/net/local/broadcast_channel_manager_test.go b/pkg/net/local/broadcast_channel_manager_test.go
index c6c5c8216f..8427162865 100644
--- a/pkg/net/local/broadcast_channel_manager_test.go
+++ b/pkg/net/local/broadcast_channel_manager_test.go
@@ -96,7 +96,9 @@ func TestReleaseBroadcastChannel(t *testing.T) {
// sent, not a sign the ticker "kept firing" - so absorb it in a short
// settle window before asserting the real invariant this test cares
// about: no further deliveries once release has taken effect.
- drain(ch1Deliveries, RetransmissionTick)
+ if got := drain(ch1Deliveries, RetransmissionTick); got > 1 {
+ t.Errorf("expected at most one straggler tick after release, got %d", got)
+ }
if got := drain(ch1Deliveries, RetransmissionTick*3); got != 0 {
t.Errorf("expected no deliveries after release, got %d", got)