`VCRAPI` doesn't record `API._streaming_download()` semantics, including retries
Description
When VCRAPI._send_json_request() returns control to API._send_json_request(), it loses visibility into any downstream semantics, including retry-level request headers and responses.
Steps to Reproduce
With #2329:
- Run
make regenerate-sdk-cassettes. - Inspect the last two requests in
client/tests/sdk/data/test_download_submission.yml.
Expected Behavior
- The penultimate request shows the HTTP
416response. - The last request includes a
Rangeheader.
Actual Behavior
Both request/response pairs are identical.
Comments
The request is recorded in VCRAPI._send_json_request() and then modified in API._send_json_request() → API._streaming_download().
The HTTP 416 response is resolved in API._streaming_download() and never returned from API._send_json_request(), unlike the HTTP 404 in test_download_submission_stream_404().
This may turn out to be a wontfix: we'd need to instrument API._streaming_download() and possibly Popen, which would interfere with the special Popen used in test_download_submission_autoresume_fail(), which is the motivation for these sub-request semantics in the first place.... After #2329, I would be happy with just documenting this limitation of the test suite.
Closing; specific to current client implementation, which is undergoing a rewrite.