Skip to content

Allow decoder verification output during decodeLast - #3683

Open
Dave861 wants to merge 1 commit into
apple:mainfrom
Dave861:fix/3414-verifier-decode-last
Open

Allow decoder verification output during decodeLast#3683
Dave861 wants to merge 1 commit into
apple:mainfrom
Dave861:fix/3414-verifier-decode-last

Conversation

@Dave861

@Dave861 Dave861 commented Jul 28, 2026

Copy link
Copy Markdown

Motivation

ByteToMessageDecoderVerifier reports under-production before allowing a decoder to emit its final buffered output from decodeLast.

Modifications

  • Give each verification strategy an independent decoder and channel.
  • Compare available output while feeding input, then finish each channel exactly once.
  • Use output emitted during decodeLast to satisfy remaining expectations.
  • Preserve wrong-production, under-production, over-production, and teardown-leftover diagnostics.
  • Add regression coverage using NIOSplitUTF8LinesMessageDecoder.

Result

Decoders that correctly emit a final value from decodeLast now pass verification.

Fixes #3414

Testing

  • swift test --filter ByteToMessageDecoderVerifierTest
  • swift format lint --strict --configuration .swift-format on both changed files
  • swift test — 2,458 XCTest tests and 276 Swift Testing tests passed

Motivation:

ByteToMessageDecoderVerifier checks expected output before closing the channel,
so decoders that emit valid final output from decodeLast are incorrectly
reported as under-producing.

Modifications:

Give each verification strategy an independent decoder and channel. Defer the
under-production decision until after finishing, then compare output emitted
during decodeLast while preserving existing diagnostics. Add regression
coverage using NIOSplitUTF8LinesMessageDecoder.

Result:

The verifier accepts valid final output emitted during decodeLast.
@Dave861
Dave861 marked this pull request as ready for review July 28, 2026 11:45
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.

NIOTestUtils.ByteToMessageDecoderVerifier fails too early

1 participant