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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user