Skip to content

test(client): fix tests to setup fully knowledgeable Presence#25734

Merged
jason-ha merged 1 commit intomicrosoft:mainfrom
jason-ha:presence/test/timing-cleanup-plus
Oct 22, 2025
Merged

test(client): fix tests to setup fully knowledgeable Presence#25734
jason-ha merged 1 commit intomicrosoft:mainfrom
jason-ha:presence/test/timing-cleanup-plus

Conversation

@jason-ha
Copy link
Contributor

  • 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)

+ 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)
@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues base: main PRs targeted against main branch labels Oct 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 broadcastJoinResponseDelaysMs constants 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"

Copy link
Contributor

@WillieHabi WillieHabi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

@jason-ha jason-ha merged commit 9a7b038 into microsoft:main Oct 22, 2025
37 checks passed
@jason-ha jason-ha deleted the presence/test/timing-cleanup-plus branch October 22, 2025 22:36
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: runtime Runtime related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants