Add response_delay_seconds parameter for testing timeouts#2885
Merged
adamtheturtle merged 9 commits intomainfrom Feb 15, 2026
Merged
Add response_delay_seconds parameter for testing timeouts#2885adamtheturtle merged 9 commits intomainfrom
adamtheturtle merged 9 commits intomainfrom
Conversation
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>
7688305 to
c3ed2c4
Compare
4dccca4 to
b2dffb6
Compare
952bc2c to
67af6e6
Compare
There was a problem hiding this comment.
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.
67af6e6 to
ae2bbf9
Compare
ae2bbf9 to
a03ff48
Compare
a03ff48 to
44ac305
Compare
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>
44ac305 to
3af8012
Compare
…atic method Consolidate the duplicate VWS/VWQ route registration loops into a single loop and extract wrap_callback as a static method. Move type aliases out of TYPE_CHECKING block. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
93eafb7 to
844d38e
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… access Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
response_delay_secondsparameter to MockVWS to simulate slow HTTP responses, enabling testing of request timeout handling. When the delay exceeds a client's timeout,requests.exceptions.Timeoutis raised naturally.Test plan
Note
Low Risk
Adds an opt-in delay wrapper around mock callbacks plus new tests; no production networking or security logic is changed.
Overview
MockVWSnow accepts aresponse_delay_secondsparameter that delays every mocked VWS/VWQ response, and simulates client-side timeouts by inspecting the request’stimeout(including(connect, read)tuples) and raisingrequests.exceptions.Timeoutwhen the delay exceeds the effective read timeout.Adds focused tests validating the default no-delay behavior and timeout/non-timeout outcomes, and documents the new parameter in
CHANGELOG.rst.Written by Cursor Bugbot for commit 216fc9f. This will update automatically on new commits. Configure here.