@@ -13,10 +13,10 @@ import { clearConfigCache, clearRuntimeConfigSnapshot } from "../../../../src/co
1313import { clearSessionStoreCacheForTest } from "../../../../src/config/sessions/store-writer-state.js" ;
1414import { pickPrimaryLanIPv4 } from "../../../../src/gateway/net.js" ;
1515import { startGatewayServer , type GatewayServer } from "../../../../src/gateway/server.js" ;
16- import { getFreeGatewayPort } from "../../../../src/gateway/test-helpers.e2e.js" ;
1716import { GATEWAY_STARTUP_MUTATED_ENV_KEYS } from "../../../../src/gateway/test-helpers.env.js" ;
1817import { resetAgentEventsForTest } from "../../../../src/infra/agent-events.js" ;
1918import { captureEnv , deleteTestEnvValue , setTestEnvValue } from "../../../../src/test-utils/env.js" ;
19+ import { getFreePort } from "../../../../src/test-utils/ports.js" ;
2020import {
2121 GATEWAY_CLIENT_MODES ,
2222 GATEWAY_CLIENT_NAMES ,
@@ -365,7 +365,7 @@ export async function runGatewayLoopbackLanProof(): Promise<GatewayLoopbackLanPr
365365 ) ;
366366 resetGatewayTestState ( ) ;
367367
368- const loopbackPort = await getFreeGatewayPort ( ) ;
368+ const loopbackPort = await getFreePort ( "0.0.0.0" ) ;
369369 server = await startGateway ( loopbackPort , "loopback" , token ) ;
370370 const loopbackHealthStatus = await probeHttpHealth ( {
371371 host : "127.0.0.1" ,
@@ -384,7 +384,7 @@ export async function runGatewayLoopbackLanProof(): Promise<GatewayLoopbackLanPr
384384 await stopGateway ( server ) ;
385385 server = undefined ;
386386
387- const lanPort = await getFreeGatewayPort ( ) ;
387+ const lanPort = await getFreePort ( "0.0.0.0" ) ;
388388 server = await startGateway ( lanPort , "lan" , token ) ;
389389 const lanHealthStatus = await probeHttpHealth ( {
390390 host : lanIp ,
0 commit comments