Skip to content

[Bug]: browserType.launchServer() ignores the timeout option and can hang forever #43819

Open

Description

🤖 Generated with Claude Opus 5.5

Version

1.64.1 (also current main). Regressed in 1.54.0.

Steps to reproduce

Call browserType.launchServer({ timeout: 5000 }) when the browser stalls during startup. The repo's own test hook reproduces it:

await chromium.launchServer({ timeout: 5000, __testHookBeforeCreateBrowser: () => new Promise(f => setTimeout(f, 6000)) });

(the hook only runs under test). We hit this in production with Firefox: a launch that hung never settled, so our controller blocked until it restarted.

Expected behavior

The call rejects with Timeout 5000ms exceeded., as browserType.launch() does. Without timeout it should use the documented 180000 ms default.

Actual behavior

The call never times out. BrowserServerLauncherImpl.launchServer (packages/playwright-core/src/browserServerImpl.ts) works out launchOptions.timeout but calls controller.run(...) without it. #36455 moved launch timeouts onto ProgressController.run(task, timeout) and added the argument in remote/playwrightServer.ts, but missed this call site.

Additional context

I have a one-line fix (pass launchOptions.timeout to controller.run) plus a test modeled on BT-012 should handle timeout. I'd be happy to open a PR if you approve.

Activity

  1. github-actions commented on Oct 31, 2026

    @github-actions
  2. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot. I reproduced this and verified a fix.

    Reproduced on Chromium, Firefox and WebKit on Linux at deb7e86201e26cb4a8e25191fce5ef2f7a28aa87 (1.65.0-next). launchServer() calculates the timeout but does not pass it to the progress controller. Passing that value restores the timeout. The existing launch-timeout test now checks server launches too.

    The release check confirms the regression in 1.54.0, introduced by #36455; the same check passes on 1.53.2.

    Condensed reproduction

    The hook requires the repository's test environment (PWTEST_UNDER_TEST=1).

    import { playwrightTest as test, expect } from '../config/browserTest';
    
    test('launchServer honors startup timeout', async ({ browserType }) => {
      const options = {
        timeout: 5000,
        __testHookBeforeCreateBrowser: () => new Promise(f => setTimeout(f, 6000)),
      };
      await expect(browserType.launchServer(options).then(server => server.close()))
          .rejects.toThrow('Timeout 5000ms exceeded.');
    });

    Without the fix, the server launch succeeds after the six-second hook instead of rejecting at five seconds. The check closes that server so that the failed test does not leave it running.

    What I ran

    All runs were headless on Linux.

    Version Browsers Result
    1.53.2 Chromium bundled with that release Rejects at 5000ms as expected
    1.54.0 Chromium bundled with that release Does not time out; regression reproduced
    1.65.0-next, deb7e86201e26cb4a8e25191fce5ef2f7a28aa87 Chromium, Firefox, WebKit Server timeout assertion fails on all three; direct launch timeout works
    Same checkout with the fix Chromium, Firefox, WebKit Timeout assertion passes on all three

    Both browsertype-launch.spec.ts and browsertype-launch-server.spec.ts pass with the fix: 77 passed, 1 existing skip. The without/with-fix check was repeated before handoff. npm run build and npm run flint pass.

    Draft PR: #43826

    Triaged on Linux by the Playwright bot - agent run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions