Skip to content

fix(Storage): Resolve object context tests collisions using unique identifiers#14

Open
mahendra-google wants to merge 3 commits into
mainfrom
fix/flaky-object-context-test
Open

fix(Storage): Resolve object context tests collisions using unique identifiers#14
mahendra-google wants to merge 3 commits into
mainfrom
fix/flaky-object-context-test

Conversation

@mahendra-google

Copy link
Copy Markdown
Owner

Updated object context tests to append unique IDs to keys and values. While Unicode character changes reduced collision frequency, hardcoded values remained vulnerable during parallel CI runs. This ensures true isolation across simultaneous executions.

@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 several integration tests to use unique context keys and values by appending a GUID, preventing potential collisions during test execution. Feedback was provided regarding PatchObjectTest.cs, where the keys and values are defined inline; it is recommended to extract these into variables to maintain consistency with the other updated tests and improve the reliability of subsequent assertions.

var custom = new Dictionary<string, ObjectCustomContextPayload>
{
{ "A\u00F1\u03A9\U0001F680", new ObjectCustomContextPayload { Value = "Ab\u00F1\u03A9\U0001F680" } }
{ $"A\u00F1\u03A9\U0001F680-{IdGenerator.FromGuid()}", new ObjectCustomContextPayload { Value = $"Ab\u00F1\u03A9\U0001F680-{IdGenerator.FromGuid()}" } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Inconsistency: Unlike the other test files modified in this pull request (such as CopyObjectTest.cs and UpdateObjectTest.cs), the context key and value in this file are defined inline. Consider extracting them into variables (e.g., contextKey and contextValue) before the dictionary initialization. This maintains consistency across the test suite and ensures that the generated keys can be reliably referenced in subsequent assertions, preventing potential test failures if those assertions still use hardcoded strings.

@mahendra-google mahendra-google changed the title fix(Storage): Resolve object context tests collisions using unique id… fix(Storage): Resolve object context tests collisions using unique identifiers Apr 30, 2026
…entifiers

Updated object context tests to append unique IDs to keys and values.
While Unicode character changes reduced collision frequency, hardcoded
values remained vulnerable during parallel CI runs. This ensures
true isolation across simultaneous executions.
@mahendra-google mahendra-google force-pushed the fix/flaky-object-context-test branch from cad48c5 to 53e3326 Compare May 4, 2026 08:33
…ion test.

Remove the skip attribute from ListObjectsMatchingContextKeyValuePair
to ensure the filtering logic for context-based metadata is verified during the CI pipeline.
…stency

Extract inline dictionary key-value pairs into explicit 'contextKey'
and 'contextValue' variables within PatchObjectTest.cs.

This aligns the file with the pattern established in CopyObjectTest.cs
and UpdateObjectTest.cs, improving readability and ensuring a uniform
approach to context-based metadata testing across test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant