From f1ebb74acced1fb53dfe112d9317ccd1c5e9ea2b Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Wed, 21 Oct 2026 10:49:13 +1000 Subject: [PATCH] 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. --- spinifex/daemon/daemon_handlers_platform_inventory_test.go | 3 +++ spinifex/daemon/platform_disclosure_current_behaviour_test.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/spinifex/daemon/daemon_handlers_platform_inventory_test.go b/spinifex/daemon/daemon_handlers_platform_inventory_test.go index 174f73076..c2ed15998 100644 --- a/spinifex/daemon/daemon_handlers_platform_inventory_test.go +++ b/spinifex/daemon/daemon_handlers_platform_inventory_test.go @@ -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) diff --git a/spinifex/daemon/platform_disclosure_current_behaviour_test.go b/spinifex/daemon/platform_disclosure_current_behaviour_test.go index 8d572933f..e2e0750be 100644 --- a/spinifex/daemon/platform_disclosure_current_behaviour_test.go +++ b/spinifex/daemon/platform_disclosure_current_behaviour_test.go @@ -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)