Skip to content

fix: correct length field size, reserved tag range, and flaky test assertion#95

Open
immanuwell wants to merge 1 commit into
dragonflyoss:mainfrom
immanuwell:fix/doc-and-test-inaccuracies
Open

fix: correct length field size, reserved tag range, and flaky test assertion#95
immanuwell wants to merge 1 commit into
dragonflyoss:mainfrom
immanuwell:fix/doc-and-test-inaccuracies

Conversation

@immanuwell
Copy link
Copy Markdown

@immanuwell immanuwell commented May 30, 2026

Description

Few small inaccuracies found while reading the code:

  • Vortex doc comment says Length field is 8 bytes, but it's put_u32 (4 bytes). Same comment says max value is 1 GiB but MAX_VALUE_SIZE is 4 GiB.
  • From<Vortex> for Bytes impl has a copy-paste comment saying From<PieceContent>.
  • test_header_new asserts header.id <= 254, but rng.gen::<u8>() produces 0-255, so it fails ~1/256 runs when id == 255.
  • Reserved tag comment says "for tags 6-254", correct range is 8-253 (6 and 7 are defined, 254 is Close). Same issue in docs/README.md.

Related Issue

No open issue - doc/comment/test fixes only.

Motivation and Context

Flaky test repro: run cargo test tests::test_header_new repeatedly, panics when id == 255.

…sertion

Signed-off-by: immanuwell <pchpr.00@list.ru>
@immanuwell immanuwell force-pushed the fix/doc-and-test-inaccuracies branch from 3d748cd to ffbf438 Compare May 30, 2026 10:15
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