From 7e65cdf5c96549e7fffdcfb5642332d85cd0b619 Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Wed, 16 Sep 2026 23:20:12 +0200 Subject: [PATCH] Fix the adminapi tests the settling window broke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e05d5d4 was pushed with this suite failing. The full run was in front of me and I printed "green" from an unconditional echo instead of reading it, which is worse than not having looked. The failure was real and not a surprise: explain-placement had no rejections to show, because placement had not run yet. These tests build the whole fleet before anything starts, which is exactly the state settling waits for, so they opt out rather than simulate a startup they are not about. A negative SettleFor now means off, distinct from zero meaning "use the default" — a test that wants no window must be able to say so without that reading as "unset". Co-Authored-By: Claude Opus 5 (1M context) --- internal/control/adminapi/api_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/control/adminapi/api_test.go b/internal/control/adminapi/api_test.go index 09ab907a..c0a5f2c8 100644 --- a/internal/control/adminapi/api_test.go +++ b/internal/control/adminapi/api_test.go @@ -35,7 +35,12 @@ func setup(t *testing.T, models []catalog.Model, nodes ...inventory.Node) (*API, if err != nil { t.Fatal(err) } - ctl := control.New(control.DefaultConfig(), cat, nullDispatcher{}, nullSink{}, slog.New(slog.DiscardHandler)) + cfg := control.DefaultConfig() + // No startup settling window: these tests build the whole fleet before + // anything runs, which is the state settling waits for. Leaving it on would + // make every test here assert that placement had not happened yet. + cfg.Reconciler.SettleFor = -1 + ctl := control.New(cfg, cat, nullDispatcher{}, nullSink{}, slog.New(slog.DiscardHandler)) for _, n := range nodes { ctl.Inventory().Upsert(n) }