From bc49b7249c5f24985f1361820acb81c1cc9fa824 Mon Sep 17 00:00:00 2001 From: riccardom Date: Wed, 2 Sep 2026 15:47:57 +0200 Subject: [PATCH] [client] Stop the gate test from dialing the real management server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestLogin_RestatingTheStoredConfigPassesTheGate asserts that the gate lets a no-op login through, and the handler then went on to do the login for real: isLoginRequired builds an auth client when isLoginRequiredFn is unset, so the test dialed the profile's management URL — api.netbird.io:443. It took 1.05s locally and would hang on a runner with no egress, for a fact about the gate that needs no network at all. Stubbed like the login_outcome tests do. The test now runs in 0.00s. Reported by cubic-dev-ai on PR #7398. --- client/server/update_settings_gate_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/server/update_settings_gate_test.go b/client/server/update_settings_gate_test.go index 91ca8a898..667c963a3 100644 --- a/client/server/update_settings_gate_test.go +++ b/client/server/update_settings_gate_test.go @@ -295,6 +295,11 @@ func TestLogin_RestatingTheStoredConfigPassesTheGate(t *testing.T) { s.updateSettingsDisabled = true s.rootCtx = internal.CtxInitState(context.Background()) + // Stand in for the management round trip the handler makes once the gate + // lets it through, so this test exercises the gate and not the network: + // without it the profile's management URL is dialed for real. + s.isLoginRequiredFn = func(context.Context) (bool, error) { return false, nil } + _, err := s.Login(userCtx(), &proto.LoginRequest{ Username: &username, ManagementUrl: storedManagementURL,