From cdd428a7d86a260dbbcc309a947789b96c7b940e Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 14:57:50 +0100 Subject: [PATCH] =?UTF-8?q?Node-engine:=20the=20whole=20seat-list=20case?= =?UTF-8?q?=20proves=20a=20fresh=20node=20asks=20the=20seat=20over=20its?= =?UTF-8?q?=20own=20grant=20while=20its=20own=20composition=20and=20web=20?= =?UTF-8?q?are=20held,=20no=20part=20needs=20letting=20through=20(ruling?= =?UTF-8?q?=2015:1x=20b,=20ADR=200636=20=C2=A71;=20issue=201966)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- cmd/mesh-host/nodeagent_integration_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/mesh-host/nodeagent_integration_test.go b/cmd/mesh-host/nodeagent_integration_test.go index ba08a53..a175086 100644 --- a/cmd/mesh-host/nodeagent_integration_test.go +++ b/cmd/mesh-host/nodeagent_integration_test.go @@ -60,6 +60,8 @@ type itBed struct { mu sync.Mutex // seatSilent makes the stand-in of the seat mesh-catalog refuse the seat list (it is served from the start otherwise). seatSilent atomic.Bool + // seatAsked counts the node's asks of the stand-in seat, answered or refused: the node reached the bus and asked. + seatAsked atomic.Int32 findings nats.KeyValue } @@ -904,6 +906,7 @@ func (b *itBed) standInSeat() { Seat string `json:"seat"` } _ = json.Unmarshal(m.Data, &q) + b.seatAsked.Add(1) var result any switch { case b.seatSilent.Load(): @@ -979,6 +982,17 @@ func TestNatsANodeThatCannotReadTheSeatListActsOnNothingNew(t *testing.T) { defer clock.mu.Unlock() return len(clock.fire) > 0 }) + // A fresh node, nothing applied, reaches the bus and asks the seat while its own composition is held: the read needs + // the bus the node composes from and the grant it has from its start, nothing of what the hold keeps back. + if b.seatAsked.Load() == 0 { + t.Fatal("the fresh node did not ask the seat for its list while its own composition was held") + } + within(t, 5*time.Second, "the fresh node did not say it holds web and its own composition for the unread list", func() bool { + b.mu.Lock() + defer b.mu.Unlock() + said := strings.Join(b.said, "\n") + return strings.Contains(said, selfcompose.WaitsForTheSeatListOwn) && strings.Contains(said, selfcompose.WaitsForTheSeatList) + }) if b.file("web") != "" { t.Fatalf("the node applied web before it read the seat list: %q", b.file("web")) }