Skip to content

[Bug]: "TypeError: this._server.closeAllConnections is not a function" when running BiDi tests on Linux #34288

Description

Version

1.50.0-next

Steps to reproduce

Run any kind of test that destructs the server object in the test functions header like it('should type into a textarea @smoke', async ({ page, server }) => {.

Run the following steps:

  1. Clone Playwright
    2 Run npm install && npm run build
    3 Run WebDriver BiDi tests: PWTEST_USE_BIDI_EXPECTATIONS=1 DEBUG="pw:browser" PWTEST_FIREFOX_USER_PREFS='{"remote.log.level":"Trace"}' BIDIPATH=/home/henrik/code/gecko/obj/opt/dist/bin/firefox npm run biditest -- --project='bidi-firefox-nightly*' --retries=0 --workers=1 --headed tests/page/page-keyboard.spec.ts

Note that I haven't seen this problem on MacOS before.

Expected behavior

All the tests should run and not fail with this error.

Actual behavior

  TypeError: this._server.closeAllConnections is not a function

       at config/testserver/index.ts:196

      194 |     this._upgradeCallback = undefined;
      195 |     this._wsServer.removeAllListeners('connection');
    > 196 |     this._server.closeAllConnections();
          |                  ^
      197 |     const error = new Error('Static Server has been reset');
      198 |     for (const subscriber of this._requestSubscribers.values())
      199 |       subscriber[rejectSymbol].call(null, error);
        at TestServer.reset (/home/henrik/code/playwright/tests/config/testserver/index.ts:196:18)
        at TestServer.stop (/home/henrik/code/playwright/tests/config/testserver/index.ts:157:10)
        at Object.exports.serverFixtures.__servers.scope (/home/henrik/code/playwright/tests/config/serverFixtures.ts:68:14)

Additional context

No response

Environment

System:
    OS: Linux 6.8 Linux Mint 22 (Wilma)
    CPU: (4) x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
    Memory: 2.91 GB / 15.30 GB
    Container: Yes
  Binaries:
    Node: 18.0.0 - /usr/local/bin/node
    npm: 9.6.4 - /usr/local/bin/npm
  IDEs:
    VSCode: 1.96.2 - /usr/bin/code
  Languages:
    Bash: 5.2.21 - /usr/bin/bash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions