dnaeon / go-vcr

Record and replay your HTTP interactions for fast, deterministic and accurate tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

check for cancelled context when in replay mode

vangent opened this issue · comments

I have a test that calls an API that makes HTTP requests underneath with a canceled context.

When in "record" mode, the API (correctly) returns an error, and no HTTP request is made (so, nothing is added to the cassette).

However, when in "replay" mode, go-vcr doesn't check the context, so it ends up looking for the HTTP request in the cassette, and returning either some other matching HTTP request, or a "not found" error.

It would be a truer replay experience if the replay mode checked the context.