test(client): fix tests to setup fully knowledgeable Presence#25734
Merged
jason-ha merged 1 commit intomicrosoft:mainfrom Oct 22, 2025
Merged
test(client): fix tests to setup fully knowledgeable Presence#25734jason-ha merged 1 commit intomicrosoft:mainfrom
jason-ha merged 1 commit intomicrosoft:mainfrom
Conversation
+ add/improve join tests including coverage of protocol update hole + fix MockQuorum to return a copy during getMembers call + adjust test clock times to be relative to other times that may vary as tests or test setup changes + introduce `broadcastJoinResponseDelaysMs` that captures some current implementation behavior (will be updated to come from implementation soon)
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves test robustness by ensuring tests set up fully knowledgeable Presence instances and fixes timing inconsistencies in test execution.
- Fixes
MockQuorum.getMembers()to return a copy of the members map instead of the original - Introduces
broadcastJoinResponseDelaysMsconstants to capture join response timing behavior - Makes test clock times relative to dynamically computed values rather than hardcoded absolutes
- Adds comprehensive join handling tests including coverage of a protocol update hole
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/runtime/test-runtime-utils/src/mocks.ts | Fixed MockQuorum.getMembers() to return a defensive copy of the members map |
| packages/framework/presence/src/test/testUtils.ts | Added broadcastJoinResponseDelaysMs constants and updated prepareConnectedPresence to simulate join responses for full knowledge setup |
| packages/framework/presence/src/test/schemaValidation/valueManagers.spec.ts | Updated hardcoded timestamps to use relative time values based on clock.now and initialTime |
| packages/framework/presence/src/test/schemaValidation/protocol.spec.ts | Refactored test setup to use relative timestamps, removed unused constants, and added testStartTime for consistent test initialization |
| packages/framework/presence/src/test/presenceDatastoreManager.spec.ts | Added comprehensive join handling tests including protocol hole coverage, introduced helper functions, and new test data constants |
| packages/framework/presence/src/test/notificationsManager.spec.ts | Updated hardcoded timestamps to use initialTime variable for consistency |
| packages/framework/presence/src/test/batching.spec.ts | Changed hardcoded timestamps to relative values and corrected test names from "allowableUpdateLatency" to "allowableUpdateLatencyMs" |
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
…oft#25734) + add/improve join tests including coverage of protocol update hole + fix MockQuorum to return a copy during getMembers call + adjust test clock times to be relative to other times that may vary as tests or test setup changes + introduce `broadcastJoinResponseDelaysMs` that captures some current implementation behavior (will be updated to come from implementation soon)
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.
broadcastJoinResponseDelaysMsthat captures some current implementation behavior (will be updated to come from implementation soon)