chore: fix intermittent encoding test failures by handling READ_EXPIRED correctly by gnodet · Pull Request #1303 · jline/jline3 (original) (raw)

…ED correctly

Fixes jline#1296

The MultiEncodingTerminalTest was experiencing intermittent failures on Windows CI environments showing replacement characters (￾) in test output.

Root Cause: The issue was NOT in the NonBlocking implementation, but in test logic that incorrectly handled READ_EXPIRED (-2) return values from NonBlockingReader.

When NonBlockingReader.read(timeout) times out, it returns READ_EXPIRED (-2). Test code was casting this directly to char: (char)(-2) = U+FFFE = ￾

Fixed Tests:

The fix properly distinguishes between:

Tests now retry on timeout instead of treating it as a valid character, resolving the intermittent Windows CI failures.

@gnodet gnodet deleted the fix-nonblocking-reader-buffer-management branch

July 6, 2025 06:00

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

[ Show hidden characters]({{ revealButtonHref }})