Skip to content

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

Merged
gaius-qi merged 1 commit into
dragonflyoss:mainfrom
immanuwell:fix/doc-and-test-inaccuracies
Jun 2, 2026
Merged

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

Conversation

@immanuwell
Copy link
Copy Markdown
Contributor

@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
Copy link
Copy Markdown
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaius-qi gaius-qi merged commit f9d8cb2 into dragonflyoss:main Jun 2, 2026
5 checks passed
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