mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-23 04:36:40 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user