fix(storage): resolve race conditions in archived generation tests - #3341
Merged
krishnamd-jkp merged 2 commits intoAug 18, 2026
Conversation
Introduce a pre-configured versioned bucket in the StorageFixture to eliminate GCS metadata propagation delays and utilized shared versioned bucket across all generation tests
There was a problem hiding this comment.
Code Review
This pull request refactors several integration tests—specifically CopyFileArchivedGenerationTest, DeleteFileArchivedGenerationTest, and ListFileArchivedGenerationTest—to use a shared, pre-configured versioned bucket (BucketNameVersioned) from the test fixture, eliminating the need to repeatedly enable and disable versioning within individual tests. It also cleans up unused sample variables and standardizes object name generation. The review feedback correctly identifies a performance issue in DeleteFileArchivedGenerationTest.cs where an IEnumerable is enumerated multiple times, causing redundant HTTP requests, and suggests materializing the sequence to avoid this.
krishnamd-jkp
approved these changes
Aug 18, 2026
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.
This PR provides a fix to the issue and
resolves the test flakiness observed in the archived generation tests (such as
CopyFileArchivedGenerationTest,ListFileArchivedGenerationTestandDeleteFileArchivedGenerationTest).Previously, these tests were failing intermittently with
404 No such objector assertion errors (Expected: 2, Actual: 1).Because the tests were creating, deleting objects immediately after enabling versioning on the bucket, GCS had not always propagated the versioning state, resulting in objects being permanently deleted instead of archived.
This PR removes bucket versioning toggling from generation tests and introduces
BucketNameVersioned(shared versioned bucket) in theStorageFixtureand utilized shared versioned bucket across all generation tests eliminating race conditions.