fangorn/ex_git_objectstore
public
ref:3131e3054568aa2d70489af5877280e368635451
fix(test): binary-exact pack reassembly in walker property test (#63)
upload_pack_v2_walker_property_test flaked intermittently with
{:error, :pack_checksum_mismatch} (deterministic on seed 117). extract_pack/1
reassembled the pack by running the sideband response through PktLine.decode,
whose decode_one strips one trailing LF from every data packet — correct for
text lines, wrong for binary sideband pack data. When a sideband chunk's last
byte was 0x0A it was dropped, leaving the pack one byte short of its checksum.
Whether a chunk ends in 0x0A depends on pack content, hence the flake
(gitlink-to-local-commit topologies hit it often).
Production is unaffected: the server frames sideband data with encode_raw /
encode_sideband_frame (no LF appended), so the wire bytes are exact and real
git clones succeed. The bug was only in the test's reassembly.
Fix: split the response into raw length-prefixed pkt-line payloads verbatim
(no LF stripping). The asserted walker-reachability invariant is unchanged.
Verified across seeds 1-160 (~12k graph builds), 0 failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SHA:
3131e3054568aa2d70489af5877280e368635451
Author:
CI <ci@anvil.test>
Date:
2026-05-29 06:27
Parents:
ed878d9
1 files changed
+23
-8
| Type | ||
|---|---|---|
|
|
test/ex_git_objectstore/protocol/upload_pack_v2_walker_property_test.exs | +23 −8 |
|
||