test(relay): stabilize per-channel replay boundary coverage - #378
Merged
Merged
Conversation
Prepare the large signed replay fixture before the behavior test and pin its clock. Keep real socket signature verification, the 500-event filter boundary, and quiet-channel unread evidence intact; assert the hot-channel delivery count as well. Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
tellaho
marked this pull request as ready for review
September 28, 2026 22:33
tellaho
requested review from
a team,
comp615 and
wesbillman
as code owners
September 28, 2026 22:33
baxen
approved these changes
Sep 28, 2026
baxen
left a comment
Collaborator
There was a problem hiding this comment.
🤖 LGTM. Test-only change: fixture signing moves to a scoped beforeAll, clock pinned so the fixed-timestamp fixtures stay inside the filter's since window, and the per-channel replay assertions are kept plus tightened (501 delivered, hot 500/0). CI green at 01473d5.
cynfria
pushed a commit
that referenced
this pull request
Sep 28, 2026
…sh-followup * origin/main: Add message-level read and unread controls (#352) feat: add per-category notification alert sounds with app-owned playback (#356) test(relay): stabilize per-channel replay boundary coverage (#378) fix(design-system): keep button labels single-line and corners capsule-shaped (#357) Signed-off-by: Codex <noreply@openai.com>
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.
Overview
Category: infrastructure
User Impact: No application behavior changes; replay/unread regression coverage keeps its real boundary while avoiding fixture signing inside the behavior test's timeout.
Problem: The quiet-channel replay test intermittently exceeds its 5-second timeout on main because the same test both constructs 502 signed events and verifies 501 socket deliveries. Fixture signing performs its own signature verification, consuming roughly half the local case time before the behavior is exercised.
Solution: Prepare the 501-event hot-channel history in a scoped
beforeAlland pin the behavior test's clock. Keep real socket verification, session ingestion, EOSE, quiet-channel unread/attention assertions, and conservative replay evidence; add exact hot-channel delivery assertions without changing timeouts or production code.Changes
File changes
src/features/relay/live.test.ts
Separate large signed-fixture setup from the replay behavior budget. Preserve 501 distinct hot fixture events competing for a 500-event filter limit, and assert 500 hot unread messages plus the quiet mention survive the real socket/session path without incoming alerts.
Reproduction steps
bin/pnpm exec vitest run src/features/relay/live.test.ts; all 59 tests should pass with the original timeout.limited.live.tswith the former shared multi-channel filter. The quiet-message delivery assertion must fail; restore production code afterward.Validation and timing
Local macOS arm64, Hermit Node 24.18.0, Vitest 4.1.11; baseline
5ce7836b, final test blob6bf6cc3a9e943cda315737b8e5f5bbb17c05c5bf(unchanged by commit hooks).Signing cost is separated, not eliminated: the new fixture hook accounts for about 694 ms. This is timeout-budget isolation, not a suite-speedup claim. A separate CPU profile confirmed signature operations dominate; these comparisons use unprofiled runs.
BUZZ_TEST_WORKERS=2 bin/pnpm exec vitest run— 4,988 tests / 415 files passed, 212.77 s elapsed, 241.03 s summed file execution; affected case 669 ms. The run used the final working-tree bytes above before commit.delivered.has(quiet.id); production code restored, then the full suite passed.01473d51.Hosted validation of this change is pending. No local timeout reproduced, no retries/timeouts increased, no browser coverage added or removed. No independent review or human validation claimed; this PR remains draft.