Skip to content

Comments

Use same bufio.Reader size for NewConn and for tests#154

Merged
pires merged 2 commits intopires:mainfrom
emersion:fix-test-len
Feb 5, 2026
Merged

Use same bufio.Reader size for NewConn and for tests#154
pires merged 2 commits intopires:mainfrom
emersion:fix-test-len

Conversation

@emersion
Copy link
Contributor

@emersion emersion commented Feb 5, 2026

Right now, NewConn creates a bufio.Reader with a 256 bytes buffer
size, but Read tests use the default buffer size (4KiB). Align
these two so that we catch any bug related to a low buffer size in
tests.

See individual commits.

Introducing randomness for TLV sizes results in flaky,
hard-to-debug tests. Use a fixed size instead.

Use 100 bytes so that we don't overflow the 256 byte limit set in
NewConn (see next commit).
Right now, NewConn creates a bufio.Reader with a 256 bytes buffer
size, but Read tests use the default buffer size (4KiB). Align
these two so that we catch any bug related to a low buffer size in
tests.
@pires pires merged commit ae5c4de into pires:main Feb 5, 2026
8 checks passed
@emersion emersion deleted the fix-test-len branch February 5, 2026 12:00
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