Skip to content

tests(google-cloud-compute): subtle fix to compute system test test_zero_values - #18089

Merged
parthea merged 2 commits into
mainfrom
update-compute-test
Aug 12, 2026
Merged

tests(google-cloud-compute): subtle fix to compute system test test_zero_values#18089
parthea merged 2 commits into
mainfrom
update-compute-test

Conversation

@parthea

@parthea parthea commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

test_zero_values is failing in newer environments because proto-plus now wraps underlying TypeErrors in a more descriptive error message (e.g., "Failed to set field...") following #17682. This broke our rigid assertion which was looking for the exact raw tuple representation ('bad argument type for built-in operation',).

This PR updates the assertion to look for the core error substring instead, making the test robust to exception wrapping.

@parthea
parthea marked this pull request as ready for review August 12, 2026 20:10
@parthea
parthea requested a review from a team as a code owner August 12, 2026 20:10

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

Copy link
Copy Markdown
Contributor

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 simplifies the exception message assertion in the test_zero_values smoke test by removing the conditional check for Protobuf version 3. Feedback indicates that removing this check will cause test failures in environments running Protobuf v3, and suggests keeping the conditional check while updating the fallback string to match the substring instead of the exact tuple representation.

Comment on lines 83 to 84
"bad argument type for built-in operation"
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Removing the check for PROTOBUF_VERSION[0] == "3" will cause this test to fail in environments running Protobuf v3, where the exception message is "0 has type int, but expected one of: bytes, unicode" and does not contain "bad argument type for built-in operation".

We should keep the conditional check but update the else branch to look for the substring instead of the exact tuple representation.

                "0 has type int, but expected one of: bytes, unicode"
                if PROTOBUF_VERSION[0] == "3"
                else "bad argument type for built-in operation"
            ),

@parthea parthea Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All libraries in this repository require Protobuf 6.x

"protobuf >= 6.33.5, < 8.0.0",

@parthea
parthea enabled auto-merge (squash) August 12, 2026 20:17
@parthea
parthea merged commit 7b00042 into main Aug 12, 2026
46 checks passed
@parthea
parthea deleted the update-compute-test branch August 12, 2026 21:27
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.

2 participants