Skip to content

Python prompt tests count requests that other local processes send to the capture server #114

Open

Description

@ephraimduncan

sdks/python/tests/test_prompts.py::test_concurrent_calls_share_one_fetch and test_get_prompt_keeps_a_prompt_for_the_ttl_then_refreshes_it_in_the_background fail intermittently on a busy macOS machine ('assert 2 == 1', 'assert 3 == 2'). The failures also occur without the last commits of the fix of #97 (#112). The extra captured request has the headers 'user-agent': 'node' and 'sec-fetch-mode': 'cors', so a Node process, not get_prompt (urllib), sends it to the ephemeral port of the CaptureServer.

Make the tests count only their own requests, for example by the authorization header or by a path with a random part, so that a different local process cannot change the count. Then run the file 20 times in a loop and expect no failure.

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