Skip to content

test: improve MirroringInterceptor test coverage (cancel, multi-message, null checks, failure isolation)#12821

Closed
atulsingh1501 wants to merge 11 commits into
grpc:masterfrom
atulsingh1501:improve/mirroring-interceptor-test-coverage
Closed

test: improve MirroringInterceptor test coverage (cancel, multi-message, null checks, failure isolation)#12821
atulsingh1501 wants to merge 11 commits into
grpc:masterfrom
atulsingh1501:improve/mirroring-interceptor-test-coverage

Conversation

@atulsingh1501
Copy link
Copy Markdown

Fixes coverage gap in #12721 (MirroringInterceptor PoC).

The existing test only covered the basic unary mirroring scenario,
leaving coverage at ~62% (CI requires 80%).

This PR adds 5 new test cases:

  • Cancel propagation to mirror call
  • Multiple messages all being mirrored
  • Null mirrorChannel throws NullPointerException
  • Null executor throws NullPointerException
  • Mirror call failure does not affect primary call

Relates to: #12448

themechbro and others added 11 commits March 18, 2026 22:51
Add a reachability fence in shutdown() and shutdownNow() to ensure the
wrapper is not garbage collected while shutdown logic is executing.
This prevents a race condition when using directExecutor() where a
warning could be logged despite a proper shutdown.

Fixes grpc#12641
This adds a fire-and-forget interceptor that mirrors Unary and Streaming
traffic to a secondary channel without blocking the primary call.
Headers are copied and propagated safely, and the secondary call
respects the lifecycle (halfClose, cancel) of the primary stream.

Addresses the Java ClientInterceptor proposal discussed in grpc#12448
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 22, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

@atulsingh1501
Copy link
Copy Markdown
Author

Hi team! Could a maintainer please run /gcbrun to trigger the CI tests?
Happy to make any changes needed. Thank you!

@atulsingh1501
Copy link
Copy Markdown
Author

Hi team! The 4 failing tests appear to be pre-existing failures
from the base branch, not introduced by my commit. Could a maintainer
please confirm and run /gcbrun? Happy to help in any way. Thank you!

@atulsingh1501
Copy link
Copy Markdown
Author

Closing this in favor of contributing directly to themechbro's
feature branch as suggested. New PR:
themechbro#1

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