test(session): cover chunked-replay torn-tail and up_to boundary paths#5848
Merged
Conversation
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
force-pushed
the
fix/5841-chunked-replay-boundary-tests
branch
from
July 6, 2026 22:55
3aab711 to
7dd66e7
Compare
bug-ops
enabled auto-merge (squash)
July 6, 2026 22:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 torntrailing line through
ReplayEngine::replay's newSessionEventLog::read_chunkedpath on a log spanning severalREPLAY_CHUNK_SIZE(100) chunks, asserting it drops the torn line at thesame seq as the old whole-file
read_all+foldpath. Also asserts theexact expected
last_seqpositively (not just differentially), so thetest cannot pass vacuously if torn-tail dropping regressed identically on
both paths.
test_replay_up_to_matches_fold_at_chunk_boundaries(finding 2): assertsReplayEngine::replay(dir, Some(up_to))matches the Vec-basedReplayEngine::foldatup_tovalues landing at/near six chunkboundaries (99/100/101, 199/200/201) on a >200-event log.
Also added a doc-comment note on
SessionEventLog::read_chunkeddocumentingits over-read behavior (a chunk still being accumulated is fully read/parsed
before
on_chunkcan evaluate anup_tobreak) — informational only, nologic change.
No production behavior changed.
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo 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"