From 0b07e68cb8440c90cd9f5002965a7f70fd87b91a Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 5 Oct 2026 18:04:40 +0200 Subject: [PATCH] Publish the followed events once the controller's consumer exists Made from now since issue 248, the consumer does not replay what was published before it; the test raced the controller's start and published first. --- internal/link/receive_nats_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/link/receive_nats_test.go b/internal/link/receive_nats_test.go index 6f2b779..ba276e0 100644 --- a/internal/link/receive_nats_test.go +++ b/internal/link/receive_nats_test.go @@ -315,6 +315,12 @@ func TestNatsTheEventsTheControllerFollowsArriveAndAreAcknowledged(t *testing.T) ctx, stop := context.WithCancel(context.Background()) defer stop() go func() { _ = s.Serve(ctx) }() + // The controller's event consumer is made from now (novox/hq issue 248): what was published before + // it existed is history it never replays. So the announcements are made once it is there. + eventually(t, "the controller's event consumer being made", func() bool { + _, err := js.Context().ConsumerInfo("EVENTS", broker.ControllerName) + return err == nil + }) moved, _ := json.Marshal(Upgraded{Module: "gitea", Commit: "abcdef0123"}) if _, err := js.Context().Publish(broker.ControllerFollows[0], moved); err != nil {