Skip to content

Remove the race in the native CDP port test #216

Closed

Description

@lanyue-llk

tests/test_native_cdp_port.py::test_port_check_ignores_the_log_of_an_earlier_attempt fails at random in CI with DID NOT RAISE RuntimeError. It failed on PR #204 and PR #214, neither of which touches this code.

Cause

The stand-in server for the second attempt calls listen() and then exits. If the fake handshake runs in that short gap, native_cdp_browser gets a browser and the test sees no error.

Fix

Make that stand-in exit without listening, so the connection is always refused and the order is forced, the way the other tests here force theirs. Run the test repeatedly under CPU load to confirm.

Part of #87

Activity

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

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