-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
In early iterations of our test tooling, when recordings were run on vcrpy, tests used a unique way of bypassing wait times during polling operations in playback. While writing recordings to disk, the retry-after header in responses would be manually changed to be 0 so that clients would be told not to wait between polling requests when recordings were read in playback:
azure-sdk-for-python/tools/azure-sdk-tools/testutils/common_recordingtestcase.py
Lines 138 to 140 in 668f410
| def internal_scrub(key, val): | |
| if key.lower() == "retry-after": | |
| return "0" |
#35677 attempted to tackle this playback sleep skipping by adding central fixtures that monkeypatch time.sleep and asyncio.sleep methods. It would be worth revisiting our old approach, which could possibly be more broadly applied automatically without unwanted side effects. We might be able to use header sanitizers through the test proxy to record retry-after values in the same way we used to -- we'd just need to ensure that this has the desired effect in playback.