Skip to content

test(session): cover chunked-replay torn-tail and up_to boundary paths#5848

Merged
bug-ops merged 1 commit into
mainfrom
fix/5841-chunked-replay-boundary-tests
Jul 6, 2026
Merged

test(session): cover chunked-replay torn-tail and up_to boundary paths#5848
bug-ops merged 1 commit into
mainfrom
fix/5841-chunked-replay-boundary-tests

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #5841 — two test-coverage gaps left over from #5445's chunked-replay
perf pass (PR #5844). Both interactions were only hand-traced as correct
during #5445's review; neither was covered by an automated regression test.

  • test_replay_torn_tail_across_chunk_boundary (finding 1): drives a torn
    trailing line through ReplayEngine::replay's new
    SessionEventLog::read_chunked path on a log spanning several
    REPLAY_CHUNK_SIZE (100) chunks, asserting it drops the torn line at the
    same seq as the old whole-file read_all + fold path. Also asserts the
    exact expected last_seq positively (not just differentially), so the
    test cannot pass vacuously if torn-tail dropping regressed identically on
    both paths.
  • test_replay_up_to_matches_fold_at_chunk_boundaries (finding 2): asserts
    ReplayEngine::replay(dir, Some(up_to)) matches the Vec-based
    ReplayEngine::fold at up_to values landing at/near six chunk
    boundaries (99/100/101, 199/200/201) on a >200-event log.

Also added a doc-comment note on SessionEventLog::read_chunked documenting
its over-read behavior (a chunk still being accumulated is fully read/parsed
before on_chunk can evaluate an up_to break) — informational only, no
logic change.

No production behavior changed.

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins (zeph-session: 47/47 passed)
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes tests Test-related changes size/M Medium PR (51-200 lines) labels Jul 6, 2026
Close the two test-coverage gaps left over from #5445's chunked-replay
perf pass: a torn trailing line spanning multiple REPLAY_CHUNK_SIZE
chunks read via ReplayEngine::replay, and up_to landing at/near several
chunk boundaries, neither of which was previously exercised beyond a
handful of events through the new streaming path.

Closes #5841
@bug-ops
bug-ops force-pushed the fix/5841-chunked-replay-boundary-tests branch from 3aab711 to 7dd66e7 Compare July 6, 2026 22:55
@bug-ops
bug-ops enabled auto-merge (squash) July 6, 2026 22:55
@github-actions github-actions Bot removed the tests Test-related changes label Jul 6, 2026
@bug-ops
bug-ops merged commit df04ef6 into main Jul 6, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/5841-chunked-replay-boundary-tests branch July 6, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add torn-tail and up_to-boundary regression tests through the new chunked replay path

1 participant