Skip to content

test_cancellation_propagates_cleanly synchronizes on a sleep #187

Closed

Description

@lesnik512

tests/test_client_stream.py::test_cancellation_propagates_cleanly uses time to synchronize. It starts consume(), sleeps 10 ms on the assumption that body consumption has begun, then cancels, relying on the body's asyncio.sleep(1.0) still running.

If the process stalls for more than 1 s at that point, the body finishes, consume() returns normally and pytest.raises(asyncio.CancelledError) fails with DID NOT RAISE. If consumption has not begun when the cancel lands, the test still passes but no longer covers cancellation in the middle of the body.

Follow-up to #185, which fixed the same pattern in the bulkhead tests.

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