Skip to content

fix(storage): resolve race condition in compose object test - #3344

Merged
krishnamd-jkp merged 3 commits into
GoogleCloudPlatform:mainfrom
mahendra-google:fix/compose-object-test-flake
Aug 19, 2026
Merged

krishnamd-jkp merged 3 commits into
GoogleCloudPlatform:mainfrom
mahendra-google:fix/compose-object-test-flake

Conversation

@mahendra-google

Copy link
Copy Markdown
Contributor

This PR provides fix to the issue.
The flake occurred because ChangeDefaultStorageClassTest was changing the storage class of the shared bucket BucketNameGeneric to COLDLINE. When ComposeObjectTest ran concurrently, it failed with a BadRequest because it attempted to compose objects with mixed storage classes (Standard vs Coldline).
This change has removed a shared bucket BucketNameGeneric used in the ChangeDefaultStorageClassTest and introduced isolated bucket in the ChangeDefaultStorageClassTest to prevent modifying the default storage class of the shared BucketNameGeneric bucket, eliminating
test flakiness due to mixed-storage-class compose errors in ComposeObjectTest

- Use an isolated bucket in ChangeDefaultStorageClassTest to prevent modifying
the default storage class of the shared BucketNameGeneric bucket, eliminating
test flakiness and mixed-storage-class compose errors in ComposeObjectTest.

Fixes GoogleCloudPlatform#2038
@mahendra-google
mahendra-google requested review from a team as code owners August 13, 2026 11:36
@product-auto-label product-auto-label Bot added api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples. labels Aug 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the ChangeDefaultStorageClass test to use a dedicated, temporary bucket instead of a shared generic bucket, enabling safer concurrent test execution. The review feedback highlights a potential race condition in StorageFixture when creating buckets concurrently due to non-thread-safe list operations, and suggests removing the redundant step of reverting the storage class back to standard since the temporary bucket is registered for deletion.

Comment thread storage/api/Storage.Samples.Tests/ChangeDefaultStorageClassTest.cs
Comment thread storage/api/Storage.Samples.Tests/ChangeDefaultStorageClassTest.cs Outdated
krishnamd-jkp
krishnamd-jkp previously approved these changes Aug 17, 2026
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 17, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 17, 2026
@krishnamd-jkp krishnamd-jkp added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Aug 17, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2026
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2026
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 18, 2026
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2026
Increases test execution timeout to 20 minutes to prevent intermittent
timeouts in Kokoro CI test runs.
@krishnamd-jkp krishnamd-jkp added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2026
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Aug 19, 2026
@krishnamd-jkp
krishnamd-jkp merged commit 295aaa7 into GoogleCloudPlatform:main Aug 19, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants