Skip to content

Conversation

@adamtheturtle
Copy link
Member

@adamtheturtle adamtheturtle commented Feb 2, 2026

Summary

Adds response_delay_seconds parameter to MockVWS to simulate slow HTTP responses, enabling testing of request timeout handling. When the delay exceeds a client's timeout, requests.exceptions.Timeout is raised naturally.

Test plan

  • 5 new tests covering timeout behavior with raw requests and VWS client
  • All existing tests continue to pass

Note

Medium Risk
Adds timing/timeout behavior to the core MockVWS request interception by patching a private responses hook and using thread-local timeout capture, which could be brittle across library versions and affect test determinism.

Overview
Adds an optional response_delay_seconds parameter to MockVWS to artificially delay mocked VWS/VWQ responses and surface requests.exceptions.Timeout when the delay exceeds the caller’s timeout (including tuple connect/read timeouts).

Implements delay by wrapping each responses callback and patching responses.RequestsMock._on_request to capture the request’s timeout in thread-local storage; updates tests to cover default no-delay, timeout, success-with-delay, and tuple-timeout behavior, and adjusts pyproject.toml vulture ignores for new TYPE_CHECKING-only names.

Written by Cursor Bugbot for commit ddb3f0a. This will update automatically on new commits. Configure here.

This adds support for simulating slow HTTP responses in MockVWS to enable
testing of request timeout handling. When response_delay_seconds is set
higher than a client's timeout, requests.exceptions.Timeout is raised.
The delay is applied at the HTTP response level so requests' native timeout
handling triggers naturally.

Also includes 5 new tests covering timeout behavior with both raw requests
and VWS client integration.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Remove the [tool.uv.sources] section that pointed to a local
vws-python path which doesn't exist on CI runners.

Replace tests that depended on unreleased vws-python features
(request_timeout_seconds) with a test that uses tuple timeouts
directly with the requests library.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant