Errors while recording
An account error (401, 402, 403) refuses the recording. A transient error (429,
any 5xx, a stream the provider cut off, or a request that failed to reach the provider,
which the client sees as a 502) is dropped from the take if the same request is then
retried successfully, and refuses the recording otherwise. A refused recording leaves the
previous take in place and exits non-zero; its new recording stays as
<name>.take.partial, without a footer, for debugging (the summary names it), unless the
final scan finds a secret in it, in which case it is deleted.
Refusal is decided when the test or run ends; the run is never stopped early.
--allow-errors keeps every response as recorded. Other errors, such as 400, are
always kept.
| Response while recording | Default | With --allow-errors |
|---|---|---|
401, 402, 403 (account) | Refuses the recording | Kept |
429, any 5xx, a cut-off stream, a failed connection (502), then a successful retry | Dropped; the retry is kept | Kept |
| The same, never retried successfully | Refuses the recording | Kept |
Other errors, such as 400 | Kept | Kept |
--allow-errors (RETAKE_ALLOW_ERRORS) applies to the whole run. With the pytest plugin,
@pytest.mark.retake(expect_errors=[429]) keeps the listed statuses for one test; see the
plugin’s README.
Dropped and refused exchanges are listed in the recording summary. A refused recording’s
.partial file can be removed with retake clean; see
Leftover .partial files.