From 36c3331696a75212c49a0947205d840cc8da87d4 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 24 Apr 2026 09:41:17 +0200 Subject: [PATCH] chore(model): deflake cluster config tests (#10662) These have been flaky for a long time, seemingly because the multiple connection code slightly changed the timing of cluster config sending by moving them to the connection promotion loop. This adds some resiliency to that, instead of assuming that the CC:s will be immediately available after adding the connection. --------- Signed-off-by: Jakob Borg --- lib/model/model_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/model/model_test.go b/lib/model/model_test.go index ba29c8dab..745d14437 100644 --- a/lib/model/model_test.go +++ b/lib/model/model_test.go @@ -3680,15 +3680,17 @@ func testConfigChangeTriggersClusterConfigs(t *testing.T, expectFirst, expectSec m.promoteConnections() // Initial CCs + initTimeout := time.NewTimer(time.Second) + defer initTimeout.Stop() select { case <-cc1: - default: - t.Fatal("missing initial CC from device1") + case <-initTimeout.C: + t.Fatal("timed out waiting for initial CC from device1") } select { case <-cc2: - default: - t.Fatal("missing initial CC from device2") + case <-initTimeout.C: + t.Fatal("timed out waiting for initial CC from device2") } t.Log("Applying config change")