diff --git a/src/testing/testing.ts b/src/testing/testing.ts index e7a143ac7..d41683fb4 100644 --- a/src/testing/testing.ts +++ b/src/testing/testing.ts @@ -44,7 +44,8 @@ export async function createTestContext(opts?: CreateTestContextOptions): Promis await Layout.create({ entrypointPath: opts?.entrypointPath, projectRoot: opts?.projectRoot }) ) const pluginManifests = await PluginWorktime.getUsedPlugins(layout) - const randomPort = await getPort({ port: getPort.makeRange(4000, 6000) }) + const randomStartPort = Math.floor(Math.random() * (6000 - 4000)) + 4000 + const randomPort = await getPort({ port: getPort.makeRange(randomStartPort, 6000) }) const privateApp = app as PrivateApp const forcedServerSettings = {