• wwwillchen-bot's avatar
    fix: use per-worker port for fake LLM server in parallel tests (#2557) · c337156d
    wwwillchen-bot 提交于
    ## Summary
    - Pass `fakeLlmPort` through `preLaunchHook` so each parallel worker
    uses its own fake LLM server instance
    - Dynamically generate webServer configs in `playwright.config.ts` based
    on parallelism setting
    - Allow fake-llm-server to accept port via command line argument
    (`--port=XXXX`)
    
    This ensures parallel Playwright tests don't conflict when accessing the
    fake LLM server.
    
    ## Test plan
    - [x] Lint checks pass
    - [x] All 784 unit tests pass
    - [ ] Run E2E tests in parallel to verify no port conflicts
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2557"
    target="_blank">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Fixes parallel E2E conflicts by running a dedicated fake LLM server per
    Playwright worker and passing its port through preLaunchHook, env vars,
    and app/test URLs so all requests hit the worker’s server.
    
    - **Bug Fixes**
    - Compute per-worker fakeLlmPort (FAKE_LLM_BASE_PORT + parallelIndex),
    expose via preLaunchHook, set FAKE_LLM_PORT, and pass into PageObject,
    Settings, GitHubConnector; Azure tests use it for TEST_AZURE_BASE_URL.
    - Use worker-scoped URLs for Azure, GitHub test APIs, Ollama, LM Studio,
    Engine, Gateway, and OpenAI provider; Electron GitHub/Vercel handlers
    read FAKE_LLM_PORT instead of hardcoded 3500.
    - Generate one webServer per worker with build+start to avoid startup
    races; health checks target each worker; reuse servers locally; extract
    FAKE_LLM_BASE_PORT to e2e-tests/helpers/test-ports.ts.
    - fake-llm-server accepts --port or PORT with NaN validation; docs
    updated with parallel port isolation and rebase workflow notes.
    
    <sup>Written for commit 407923e90ddc9cf4d9ec98ccc56849154d2ad932.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarWill Chen <willchen90@gmail.com>
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    Co-authored-by: 's avatarclaude[bot] <41898282+claude[bot]@users.noreply.github.com>
    c337156d
名称
最后提交
最后更新
..
ai_messages_utils.ts 正在载入提交数据...
app_env_var_utils.ts 正在载入提交数据...
cleanFullResponse.ts 正在载入提交数据...
context_paths_utils.ts 正在载入提交数据...
debug_fetch.ts 正在载入提交数据...
dyad_tag_parser.ts 正在载入提交数据...
fallback_ai_model.ts 正在载入提交数据...
file_uploads_state.ts 正在载入提交数据...
file_utils.ts 正在载入提交数据...
findLanguageModel.ts 正在载入提交数据...
get_model_client.ts 正在载入提交数据...
git_author.ts 正在载入提交数据...
git_utils.ts 正在载入提交数据...
llm_engine_provider.ts 正在载入提交数据...
lm_studio_utils.ts 正在载入提交数据...
lock_utils.ts 正在载入提交数据...
mcp_consent.ts 正在载入提交数据...
mcp_manager.ts 正在载入提交数据...
mcp_tool_utils.ts 正在载入提交数据...
mention_apps.ts 正在载入提交数据...
neon_timestamp_utils.ts 正在载入提交数据...
ollama_provider.ts 正在载入提交数据...
path_utils.ts 正在载入提交数据...
port_utils.ts 正在载入提交数据...
process_manager.ts 正在载入提交数据...
provider_options.ts 正在载入提交数据...
read_env.ts 正在载入提交数据...
replacePromptReference.ts 正在载入提交数据...
retryOnLocked.ts 正在载入提交数据...
retryWithRateLimit.ts 正在载入提交数据...
ripgrep_utils.ts 正在载入提交数据...
runShellCommand.ts 正在载入提交数据...
safe_sender.ts 正在载入提交数据...
simpleSpawn.ts 正在载入提交数据...
start_proxy_server.ts 正在载入提交数据...
telemetry.ts 正在载入提交数据...
template_utils.ts 正在载入提交数据...
test_utils.ts 正在载入提交数据...
theme_utils.ts 正在载入提交数据...
thinking_utils.ts 正在载入提交数据...
token_utils.ts 正在载入提交数据...
vercel_utils.ts 正在载入提交数据...
versioned_codebase_context.ts 正在载入提交数据...