Repository navigation
Lose only answers to writes Drive carried out in the live tests - #458
Draft
shcheklein wants to merge 2 commits into
Draft
shcheklein wants to merge 2 commits into
shcheklein wants to merge 2 commits into
Conversation
The lost-answer tests replaced every matching answer with a lost connection, also a rate limit that said Drive had done nothing. Under load all tries of a write could be refused that way, and a test then found nothing on Drive. Refusals now reach the filesystem as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shcheklein
commented
Dec 3, 2026
shcheklein
commented
Dec 3, 2026
shcheklein
left a comment
Member
Author
There was a problem hiding this comment.
[AI generated — Copilot]
5-pass review summary: clean, targeted fix for rate-limit CI flakiness in lose_answers. One now-dead parameter (skip) left to remove.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No actionable issues were found in the reviewed changes to pydrive2/test/test_fs.py.
No open issues 🎉
What changed in this PR
Refines the live write-retry tests from #443 so rate-limit refusals are not mistaken for lost answers to completed writes. Production code is unchanged.
Changes:
- Lose only 2xx responses and
409 fileIdInUse; pass other responses through unchanged. - Remove the shortcut-copy test’s now-unnecessary
skipparameter.
| File | Description |
|---|---|
pydrive2/test/test_fs.py |
Filters simulated answer loss to completed writes and simplifies shortcut-copy testing. |
Review effort: Balanced
This branch has not been deployed
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.
A live test from #443 failed on an unrelated PR while CI was under Drive's rate limit:
The test lets Drive carry out a move and then replaces the answer with a lost connection, four times. It expects the file to be moved once. Its fixture replaced every matching answer, including Drive's
403 rateLimitExceeded, which means Drive did nothing. When all four tries were refused that way, the test lost four refusals and found the file unmoved.The fixture now loses only answers to requests Drive carried out: a 2xx success, or the
409 fileIdInUsethat says an earlier try already did the work. Any other answer, including another kind of 409 and a308that asks for the next part of an upload, reaches the filesystem unchanged. A refusal, such as a rate limit, reaches the filesystem unchanged, and the filesystem handles it as it always does. The test checks what it was written for, a write whose answer was lost, even when CI is busy.The shortcut copy test no longer needs
skip=1, so the parameter is gone. Drive's refusal of the first copy (an ID meant for files,400) is no longer counted.Test-only change. The lost-answer tests pass against the local fake Drive.
🤖 Generated with Claude Code