Skip to content

Commit 22ce70f

Browse files
kruskallblakerouse
andauthoredSep 10, 2024··
test: use random free grpc port when starting the manager (#5467)
* test: use random free grpc port when starting the manager by default a manager uses port 6789 but that might be already in use (for example by an elastic-agent already running on the system ;)) set port to 0 so the kernel can pick a free port each time * Update manager_fake_input_test.go * Update manager_fake_input_test.go --------- Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
1 parent 96e02e0 commit 22ce70f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎internal/pkg/agent/application/coordinator/coordinator_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,9 @@ func createCoordinator(t *testing.T, ctx context.Context, opts ...CoordinatorOpt
893893
require.NoError(t, err)
894894

895895
monitoringMgr := newTestMonitoringMgr()
896-
rm, err := runtime.NewManager(l, l, ai, apmtest.DiscardTracer, monitoringMgr, configuration.DefaultGRPCConfig(), false)
896+
cfg := configuration.DefaultGRPCConfig()
897+
cfg.Port = 0
898+
rm, err := runtime.NewManager(l, l, ai, apmtest.DiscardTracer, monitoringMgr, cfg, false)
897899
require.NoError(t, err)
898900

899901
caps, err := capabilities.LoadFile(paths.AgentCapabilitiesPath(), l)

0 commit comments

Comments
 (0)
Please sign in to comment.