Fix flaky TableClientTest.testTableAPIServerSideRouting#4802
Open
void-ptr974 wants to merge 1 commit into
Open
Fix flaky TableClientTest.testTableAPIServerSideRouting#4802void-ptr974 wants to merge 1 commit into
void-ptr974 wants to merge 1 commit into
Conversation
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.
Motivation
TableClientTest.testTableAPIServerSideRoutingcan fail intermittently withtxnResult.isSuccess()returning false.Observed failure:
java.lang.AssertionErroratTableClientTest.java:257RoutingHeaderProxyInterceptorfailed while parsing the proxiedTxnRequestforstreamId=1026,rangeId=1030, and routing keytxn-key.The server-side routing proxy forwards table requests as
InputStreams. When the interceptor tries to rewrite the routing header, it reads the request stream first. If parsing or interception fails, the old fallback returned the sameInputStreaminstance. At that point the stream has already been consumed, so the backend receives an empty or partially consumed request instead of the original request body. That can make the proxied txn fail and surfaces as the flaky integration test failure.Changes
InputStreamrequests.IdentityInputStreamMarshallerand verifies the delegate receives a fresh stream with the original payload.Testing