From 7bb154ad02922d936de6dea705d906082a76a9e0 Mon Sep 17 00:00:00 2001 From: Yacov Manevich Date: Wed, 11 Mar 2026 16:24:58 +0100 Subject: [PATCH] Prevent enqueuing message to a closed ingress channel Signed-off-by: Yacov Manevich --- testutil/node.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testutil/node.go b/testutil/node.go index a86aed2f..2cc09eee 100644 --- a/testutil/node.go +++ b/testutil/node.go @@ -115,6 +115,11 @@ func (b *BasicNode) enqueue(msg *simplex.Message, from, to simplex.NodeID) { b.RecordMessageTypeSent(msg) + if b.shouldStop.Load() { + b.l.Debug("Node is stopped, not enqueuing message", zap.Stringer("from", from), zap.Stringer("to", to)) + return + } + select { case b.ingress <- struct { msg *simplex.Message