Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Jan 21, 2026

Summary

  • use a concrete loopback host in the local e2e runner to avoid Windows localhost resolution issues

Testing

  • bun test (packages/opencode) failed: ENOSPC in /tmp
  • bun run test:e2e:local (packages/app) failed: ENOSPC in /tmp
  • bun turbo typecheck (git hook)

Greptile Summary

Replaced localhost with 127.0.0.1 throughout the e2e local test runner to avoid Windows DNS resolution issues.

  • Introduced serverHost variable with environment override support via OPENCODE_E2E_SERVER_HOST
  • Updated all four occurrences: Playwright server host, Vite server host, server spawn hostname, and health check URL
  • Maintains consistency across the entire e2e flow from server spawn to test runner configuration

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple, focused fix that addresses a known Windows issue with localhost DNS resolution by using the explicit loopback IP address 127.0.0.1 instead. All usages are consistently updated, the implementation includes environment variable override capability for flexibility, and the change follows a clear pattern addressing a documented problem from the commit history.
  • No files require special attention

Important Files Changed

Filename Overview
packages/app/script/e2e-local.ts Changed localhost to 127.0.0.1 to fix Windows resolution issues; clean implementation

Sequence Diagram

sequenceDiagram
    participant Script as e2e-local.ts
    participant Env as Environment
    participant Seed as seed-e2e.ts
    participant Server as OpenCode Server
    participant Health as Health Check
    participant Runner as E2E Test Runner
    
    Script->>Env: Read OPENCODE_E2E_SERVER_HOST
    Env-->>Script: Return 127.0.0.1 (default)
    Script->>Script: Acquire free ports
    Script->>Script: Create temp sandbox
    
    Script->>Seed: Spawn with serverEnv
    Seed-->>Script: Exit with code 0
    
    Script->>Server: Spawn on 127.0.0.1:serverPort
    Note over Server: Previously used localhost
    
    Script->>Health: Poll http://127.0.0.1:serverPort/global/health
    Health-->>Script: Health check OK
    
    Script->>Runner: Spawn with runnerEnv
    Note over Runner: PLAYWRIGHT_SERVER_HOST=127.0.0.1<br/>VITE_OPENCODE_SERVER_HOST=127.0.0.1
    Runner-->>Script: Exit with test results
    
    Script->>Server: Kill process
Loading

Use a concrete loopback host for the e2e server and health checks to avoid Windows localhost resolution issues.
@shuv1337 shuv1337 merged commit 6e9d06b into integration Jan 21, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants