fix: flush daemon subscriptions before platform inventory test requests

The inventory and disclosure test helpers subscribed on one connection and
requested on another, so a request could reach the server before its SUBs
and fail with no responders under load.
This commit is contained in:
Julian Sommer
2026-10-21 10:49:13 +10:00
parent bde54ffd2f
commit f1ebb74acc
2 changed files with 6 additions and 0 deletions
@@ -164,6 +164,9 @@ func newInventoryCluster(t *testing.T) *inventoryCluster {
d.placementGroupService = groups
d.launchTemplateService = templates
require.NoError(t, d.subscribeAll())
// The caller is a separate connection, so the server must hold the SUBs
// before it publishes or the request can see no responders.
require.NoError(t, nc.Flush())
c.caller, err = nats.Connect(ns.ClientURL())
require.NoError(t, err)
@@ -61,6 +61,9 @@ func newDisclosureCluster(t *testing.T) *disclosureCluster {
require.NoError(t, err)
d.wirePlatformTagIndex()
require.NoError(t, d.subscribeAll())
// The caller is a separate connection, so the server must hold the SUBs
// before it publishes or the request can see no responders.
require.NoError(t, nc.Flush())
caller, err := nats.Connect(ns.ClientURL())
require.NoError(t, err)