Repository navigation
Remove duplicate server tests and the dead code they kept alive - #4375
Merged
Merged
Conversation
Remove server, db, domain and contract tests that duplicate stronger owner-boundary tests, pin incidental literals, or cannot fail, together with the dead production code only those tests reached: hasCompletedEventLoopWorkForTests, pruneThreadEventsBeforeSequence and its transaction variant, claimQueuedThreadMessage, and isAgentDelegatedChildThread (inlined). The isParentNotifiableChildThread unit tests stay because no boundary test reaches the fork-with-parent clause. The randomized timeline-context-order-cache test now prunes through the live advanceThreadPruning path and asserts that it removes rows. Claim fixtures use claimQueuedThreadMessageGroup with an explicit-send policy. The test-only createHostDaemonClient moves from the host-daemon-contract source into its one server test; the wire schema is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
Many server, db, domain and contract tests duplicated a stronger test at the owning boundary. Examples:
Others pinned incidental literals, such as exact gzip byte counts in
payload-size.test.tsand copied icon and logo lists. Some couldn't fail at all: a check for a connect route that doesn't exist, and a "migrates without throwing" test that every db test already repeats.A few kept dead production code alive:
hasCompletedEventLoopWorkForTests(no callers since Keep destroyed environment rows instead of pruning them #4259)pruneThreadEventsBeforeSequence(no callers since Prune redundant event snapshots with resumable maintenance #3766)claimQueuedThreadMessagecreateHostDaemonClientin the host-daemon-contract sourceWhat changed
Found by a read-only test audit using the repo
test-auditskill (#4361).hasCompletedEventLoopWorkForTestspruneThreadEventsBeforeSequenceand its transaction variant. The other prune wrappers are unchanged.claimQueuedThreadMessage. Test call sites useclaimQueuedThreadMessageGroupwith{ kind: "explicit-send" }.isAgentDelegatedChildThread, inlined.timeline-context-order-cachetest now prunes through the liveadvanceThreadPruningpath, and asserts that rows are actually pruned.createHostDaemonClientmoves into its only user,internal-session-protocol-version.test.ts. The wire schema is unchanged, so noHOST_DAEMON_PROTOCOL_VERSIONbump.requestMatchesEntityTagcases and pending-interactionreason.thread_dynamic_context_file_statestable (no writer since Remove dead code and simplify module surfaces #2140) and its schema test. Dropping it needs a migration decision.Production +1/−117, tests +137/−1555.
How you verified
pnpm exec turbo run test lint typecheckpasses for@bb/server,@bb/db,@bb/domain,@bb/server-contractand@bb/host-daemon-contract.@bb/servertimeouts at load average 40. The base commit shows them too, and they pass when rerun alone.no-commentserrors match base.PluginIcon.test.tsx("resolves every named branding.icon the shipped plugins declare").isParentNotifiableChildThreadclauses stay caught.🤖 Generated with Claude Code