Skip to content

Add unit tests for MarshalerInputStream - #8784

Draft
Vicky677 wants to merge 1 commit into
open-telemetry:mainfrom
Vicky677:grpc-unit-test-add
Draft

Add unit tests for MarshalerInputStream#8784
Vicky677 wants to merge 1 commit into
open-telemetry:mainfrom
Vicky677:grpc-unit-test-add

Conversation

@Vicky677

@Vicky677 Vicky677 commented Sep 9, 2026

Copy link
Copy Markdown

Description

Adds comprehensive unit test coverage for io.opentelemetry.exporter.internal.grpc.MarshalerInputStream in opentelemetry-exporter-common.

Test scenarios covered:

  • available():
    • Checking available bytes when backed by a MessageWriter.
    • Checking available bytes when backed by a partial ByteArrayInputStream.
    • Returning 0 after the stream has been fully drained.
  • drainTo(OutputStream):
    • Draining directly from a MessageWriter.
    • Draining from an already existing partial stream.
    • Returning 0 written bytes when called on an already drained stream.
  • read() (single byte):
    • Reading single bytes sequentially until EOF (-1) from a MessageWriter.
    • Reading single bytes from a partial stream.
    • Returning -1 on already drained stream.
  • read(byte[], int, int) (bulk read):
    • Reading bulk byte array from a MessageWriter and verifying EOF on subsequent read.
    • Handling 0-length messages properly.
    • Reading bulk bytes from a partial stream.
    • Returning -1 on already drained stream.

@Vicky677
Vicky677 requested a review from a team as a code owner September 9, 2026 15:24
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

  • ✅ login: Vicky677 / name: Abhishek.Ghosh11 (38251b8)

@Vicky677
Vicky677 marked this pull request as draft September 9, 2026 15:50
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.

1 participant