Skip to content

Conversation

@konstantin-msft
Copy link
Collaborator

  • Clean up BroadcastChannel resources to fix hanging tests

Copilot AI review requested due to automatic review settings September 11, 2025 18:57
@konstantin-msft konstantin-msft requested a review from a team as a code owner September 11, 2025 18:57
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 addresses resource leakage issues in the test suite by implementing proper cleanup mechanisms for BroadcastChannel instances, which were causing tests to hang and requiring the --forceExit flag.

Key changes:

  • Implements tracking and cleanup for BroadcastChannel instances across test environments
  • Removes the --forceExit flag from Jest configuration since proper cleanup eliminates the need for it
  • Adds cleanup hooks in test setup files to ensure resources are cleaned up after each test

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
shared-configs/jest-config/setupGlobals.cjs Adds BroadcastChannel tracking and cleanup utilities for browser test environment
lib/msal-browser/test/utils/BridgeSetup.ts Adds cleanup hooks to ensure BroadcastChannels are cleaned up after tests
lib/msal-browser/test/app/PCANonBrowser.spec.ts Implements BroadcastChannel tracking and cleanup for Node.js test environment
lib/msal-browser/package.json Removes --forceExit flag from Jest test command

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@AzureAD AzureAD deleted a comment from Copilot AI Sep 11, 2025
@konstantin-msft konstantin-msft merged commit 678d35f into dev Sep 11, 2025
6 checks passed
@konstantin-msft konstantin-msft deleted the fix_hanging_tests branch September 11, 2025 20:57
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.

4 participants