Repository navigation
test(session): characterize lifecycle interleavings - #949
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced Aug 31, 2026
benvinegar
marked this pull request as ready for review
August 31, 2026 17:52
Contributor
Greptile SummaryThis PR adds characterization coverage for session connection and client lifecycle interleavings without changing production behavior.
Confidence Score: 4/5The PR appears safe to merge, with non-blocking test-maintainability issues around unchecked partial mocks and cleanup of process-wide replacements. The lifecycle assertions align with the current production guards, while the accepted concerns are limited to fixture type safety and preventing cascading test contamination if setup fails. Files Needing Attention: src/session/broker/brokerClient.test.ts Important Files Changed
Prompt To Fix All With AI### Issue 1
src/session/broker/brokerClient.test.ts:164
**Unchecked partial test doubles**
The new credentials, timer, WebSocket, and client fixtures use `as any` or `as unknown as`, contrary to the repository convention of using `@total-typescript/shoehorn` for partial mocks. These casts suppress structural checks, so production interface changes can leave the lifecycle tests compiling against stale or incomplete fixture shapes.
### Issue 2
src/session/broker/brokerClient.test.ts:719
**Global mocks precede cleanup guard**
The deterministic clock is installed before the restoring `try/finally` begins, and the later test repeats this pattern for both timers and WebSocket. A setup exception in that gap leaves process-wide replacements active because `afterEach` does not restore them, causing cascading hangs or misleading failures in subsequent tests.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "test(session): characterize lifecycle in..." | Re-trigger Greptile |
1 task
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
test.todofor the next stacked PRStack
Non-goals
Validation
bun test packages/session-broker/src/connection.test.ts src/session/broker/brokerClient.test.ts— 38 pass, 1 intentional todobunx oxfmt --check packages/session-broker/src/connection.test.ts src/session/broker/brokerClient.test.ts .changeset/quiet-lifecycles-characterize.mdbun run typecheckbun run lintbun run deps:checkThe repository-wide format command also scanned ignored
.pi-subagentshandoff artifacts created during review and reported only those files; the changed files pass the targeted formatter check.This PR description was generated by Pi using gpt-5.6-sol