From 9abe0b59fa101691b5e07d6735409796b06f692d Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 24 Oct 2026 22:37:46 +0200 Subject: [PATCH] Give back the connection name a test's in-process command line set (issue 1945) runLine runs the controller's dispatch in the test process, which names every later connection after the line's verb: the proposals tests left "mesh-controller verb settings", and the conditions verb's test later in the same process read that name instead of its own. --- cmd/mesh-controller/terminal_settings_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/mesh-controller/terminal_settings_test.go b/cmd/mesh-controller/terminal_settings_test.go index 3c8c4d8d..3962862a 100644 --- a/cmd/mesh-controller/terminal_settings_test.go +++ b/cmd/mesh-controller/terminal_settings_test.go @@ -9,6 +9,8 @@ import ( "testing" "git.novox.be/novox/mesh-sdk/go/catalogue" + + "github.com/novox/mesh-controller/internal/broker" ) // Where root creates and owns a module's directories, and which of the machine's paths reach its container, @@ -39,8 +41,10 @@ func atTheTerminal(t *testing.T, argv ...string) error { func runLine(t *testing.T, argv []string) error { t.Helper() - before := os.Args - defer func() { os.Args = before }() + before, named := os.Args, broker.ConnectionName + // run names every connection this process dials after the line's verb; a later test in this process would dial as + // that verb (issue 1945: a conditions test saw "mesh-controller verb settings"). + defer func() { os.Args, broker.ConnectionName = before, named }() os.Args = append([]string{"mesh-controller"}, argv...) return run() }