Skip to content

MockFluidDataStoreRuntime dispose triggers dispose event#27276

Open
CraigMacomber wants to merge 3 commits into
microsoft:mainfrom
CraigMacomber:MockDispose
Open

MockFluidDataStoreRuntime dispose triggers dispose event#27276
CraigMacomber wants to merge 3 commits into
microsoft:mainfrom
CraigMacomber:MockDispose

Conversation

@CraigMacomber
Copy link
Copy Markdown
Contributor

@CraigMacomber CraigMacomber commented May 11, 2026

Description

MockFluidDataStoreRuntime dispose triggers dispose event.
This makes it work more like the real version, and may help cleanup resources (or test resource cleanup) in some cases.

I noticed this was missing since node was emitting warnings about memory leaks due to large numbers of subscriptions to this event, and when looking at the code it was never getting triggered.

This makes it possible to trigger the dispose event, however it does not fix the memory leaks in tests causing large numbers of subscriptions to this.

Reviewer Guidance

The review process is outlined on this wiki page.

Copilot AI review requested due to automatic review settings May 11, 2026 19:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (6 lines, 1 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copy link
Copy Markdown
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 aims to bring MockFluidDataStoreRuntime’s disposal behavior closer to the real IFluidDataStoreRuntime by ensuring a dispose-related event is fired when dispose() is called, enabling test code to clean up event subscriptions.

Changes:

  • Emit an event from MockFluidDataStoreRuntime.dispose() when the mock runtime is disposed.

Comment thread packages/runtime/test-runtime-utils/src/mocks.ts Outdated
CraigMacomber and others added 2 commits May 14, 2026 13:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants