fix(Storage): Resolve object context tests collisions using unique identifiers#14
fix(Storage): Resolve object context tests collisions using unique identifiers#14mahendra-google wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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()}" } } |
There was a problem hiding this comment.
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.
…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.
cad48c5 to
53e3326
Compare
…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.
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.