fix(flaky test): use proto.Equal for gRPC status comparison in TestUpdateFeature - #2774
Merged
Conversation
The status error comparison used assert.Equal on serialized proto bytes, which is non-deterministic when ErrorInfo.Metadata has multiple map entries (messageKey + field). Switch to proto.Equal for semantic comparison. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Attempts to stabilize TestUpdateFeature by semantically comparing gRPC statuses.
Changes:
- Adds protobuf comparison support.
- Reworks success and error assertions.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
proto.Equal on Status.Proto() compares Any.value raw bytes, which still suffers from non-deterministic map serialization in ErrorInfo.Metadata. Instead, compare code/message individually and use Details() to unpack each Any into its concrete proto.Message before comparing with proto.Equal. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
t-kikuc
marked this pull request as ready for review
August 14, 2026 06:10
t-kikuc
enabled auto-merge (squash)
August 14, 2026 06:10
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.
What this PR does
Fix flaky
TestUpdateFeature/fail:_variation_value_schema_violation_returns_InvalidArgumentby replacingassert.Equalwithproto.Equalfor gRPC status error comparison.Background
The test added in #2765 compares gRPC status errors using
assert.Equal, which compares serialized proto bytes. WhenErrorInfo.Metadatacontains multiple map entries (messageKey+field), Go's non-deterministic map iteration order causes the proto serialization order to vary between runs, leading to intermittent test failures. Usingproto.Equalperforms semantic comparison that is insensitive to map field ordering.