Skip to content

test(flexiband): self-terminate demux at first malformed frame#59

Merged
zsoerenm merged 1 commit into
masterfrom
gnssdecoder-stream
Jun 23, 2026
Merged

test(flexiband): self-terminate demux at first malformed frame#59
zsoerenm merged 1 commit into
masterfrom
gnssdecoder-stream

Conversation

@zsoerenm

Copy link
Copy Markdown
Member

What

The III-7a integration test now stops the demux at the first malformed USB frame instead of reading all the way to EOF.

Why

The Flexiband III-7a capture is only well-formed for its first ~13.68 s; the trailing ~2 s has broken 0x55 0xAA preambles and demuxes to noise. This is the same capture-tail artifact diagnosed in Tracking.jl #157 / #158.

iii7a_read_bands! did not validate the frame preamble, so it fed those garbage tail frames into track!/decode.

Change

  • Check the 0x55 0xAA preamble on each frame; stop at the first bad one and return only the valid prefix. When a window comes back short, the next read returns empty and the existing isempty(l1) && break ends the tracking loop cleanly.
  • Document that the demux is already windowed — one 0.2 s chunk read straight from the decompressing zip stream, never materializing the full ~1.93 GB .usb, so memory stays bounded (lighter than #158's retain-then-@view approach; no OOM risk here).

Notes

The integration test is opt-in (GNSSDECODER_RUN_INTEGRATION_TEST=true) and downloads a 1.6 GB capture, so it was not run end-to-end here. The preamble logic mirrors the verified read_payload in Tracking.jl #158. Change is JuliaFormatter 2.8.5 clean.

🤖 Generated with Claude Code

The III-7a capture is only well-formed for its first ~13.68 s; the
trailing ~2 s has broken `0x55 0xAA` preambles and demuxes to noise (cf.
Tracking.jl #157/#158). `iii7a_read_bands!` didn't validate the preamble,
so it fed those garbage tail frames into `track!`/`decode`.

Stop at the first bad preamble and return only the valid prefix. When a
window comes back short the next read returns empty and the existing
`isempty(l1) && break` ends the tracking loop cleanly.

The demux was already windowed (one 0.2 s chunk read straight from the
decompressing zip stream, never materializing the full ~1.93 GB `.usb`),
so memory stays bounded; document that alongside the new termination.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.67%. Comparing base (8aa692a) to head (1d77958).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #59   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files          10       10           
  Lines        1336     1336           
=======================================
  Hits         1305     1305           
  Misses         31       31           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zsoerenm
zsoerenm merged commit b1ad4fd into master Jun 23, 2026
9 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.

1 participant