c_glib: fix testbinaryprotocol expectation for non-versioned message headers - #3676
Merged
Merged
Conversation
Client: c_glib The complex-types round trip wrote a bare int32 for the non-versioned message case and expected read_message_begin to return without consuming a name, type and sequence id. read_message_begin reads them since commit 280d977, which left the case failing and the rest of the stream misaligned. Send a complete old-style header and verify what was read back. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
testbinaryprotocolcurrently fails on master:test_read_and_write_complex_typescovers the case where the leading int32 of amessage is non-negative. The client wrote a bare
int32for it and the serverasserted that
read_message_beginreturned success — which it did, because thefunction had no branch for the old-style (non-versioned) header and returned
without consuming a name, message type or sequence id.
Since 280d977 that branch exists, so the call now reads those three fields.
The four bytes the test wrote are no longer a complete message, the read fails,
and everything after it in the shared socket stream is misaligned, which is why
the failure shows up twice (once in the server child, once in the parent's
status == 0assertion).This sends a complete old-style header for that case — name length + name,
message type, sequence id — and verifies what the server read back, so the case
now exercises the branch it is named after and the stream stays in sync.
Verified with the c_glib suite via cmake in
thrift:jammy: 20/20 pass, wheremaster is 19/20.
🤖 Generated with Claude Code