-
Notifications
You must be signed in to change notification settings - Fork 25k
Fix Modal Fantom test #54811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alanleedev
wants to merge
1
commit into
facebook:main
Choose a base branch
from
alanleedev:export-D88538595
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix Modal Fantom test #54811
+27
−19
Conversation
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
|
@alanleedev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88538595. |
cf26dad to
eba64a4
Compare
alanleedev
added a commit
to alanleedev/react-native
that referenced
this pull request
Dec 9, 2025
Summary:
Test was failing in CI with following error:
```
Summary of all failing tests
FAIL packages/react-native/Libraries/Modal/__tests__/Modal-itest.js (5.619 s)
● <Modal> (hermes) › props › presentationStyle › renders a Modal with presentationStyle="pageSheet"
Exception in HostFunction: MessageQueue is not empty
at validateEmptyMessageQueue (native)
417 | require('react-native/src/private/testing/fantom/specs/NativeFantom').default;
418 |
> 419 | NativeFantom.validateEmptyMessageQueue();
| ^
420 | }
421 |
422 | function serializeError(error: Error): FailureDetail {
at validateEmptyMessageQueue (private/react-native-fantom/runtime/setup.js:419:41)
at invokeHooks (private/react-native-fantom/runtime/setup.js:286:11)
at spec (private/react-native-fantom/runtime/setup.js:336:16)
at suite (private/react-native-fantom/runtime/setup.js:390:20)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at currentContext (private/react-native-fantom/runtime/setup.js:436:20)
at anonymous (private/react-native-fantom/runtime/setup.js:470:27)
```
The Modal Fantom test was failing in CI with "MessageQueue is not empty" error. This was caused by Modal's componentDidMount subscribing to ModalEventEmitter, which schedules work in the message queue. When Fantom's afterEach hook runs validateEmptyMessageQueue(), it detects pending work and fails the test.
Added Fantom.runWorkLoop() call at the end of the test to flush any pending messages in the queue before the test completes. This follows the established pattern used throughout the Fantom test suite for handling async operations.
Changelog: [Internal] Fix Fantom test
Differential Revision: D88538595
alanleedev
added a commit
to alanleedev/react-native
that referenced
this pull request
Dec 9, 2025
Summary:
Test was failing in CI with following error:
```
Summary of all failing tests
FAIL packages/react-native/Libraries/Modal/__tests__/Modal-itest.js (5.619 s)
● <Modal> (hermes) › props › presentationStyle › renders a Modal with presentationStyle="pageSheet"
Exception in HostFunction: MessageQueue is not empty
at validateEmptyMessageQueue (native)
417 | require('react-native/src/private/testing/fantom/specs/NativeFantom').default;
418 |
> 419 | NativeFantom.validateEmptyMessageQueue();
| ^
420 | }
421 |
422 | function serializeError(error: Error): FailureDetail {
at validateEmptyMessageQueue (private/react-native-fantom/runtime/setup.js:419:41)
at invokeHooks (private/react-native-fantom/runtime/setup.js:286:11)
at spec (private/react-native-fantom/runtime/setup.js:336:16)
at suite (private/react-native-fantom/runtime/setup.js:390:20)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at currentContext (private/react-native-fantom/runtime/setup.js:436:20)
at anonymous (private/react-native-fantom/runtime/setup.js:470:27)
```
The Modal Fantom test was failing in CI with "MessageQueue is not empty" error. This was caused by Modal's componentDidMount subscribing to ModalEventEmitter, which schedules work in the message queue. When Fantom's afterEach hook runs validateEmptyMessageQueue(), it detects pending work and fails the test.
Added Fantom.runWorkLoop() call at the end of the test to flush any pending messages in the queue before the test completes. This follows the established pattern used throughout the Fantom test suite for handling async operations.
Changelog: [Internal] Fix Fantom test
Differential Revision: D88538595
548788e to
0b2e55e
Compare
alanleedev
added a commit
to alanleedev/react-native
that referenced
this pull request
Dec 9, 2025
Summary:
Test was failing in CI with following error:
```
Summary of all failing tests
FAIL packages/react-native/Libraries/Modal/__tests__/Modal-itest.js (5.619 s)
● <Modal> (hermes) › props › presentationStyle › renders a Modal with presentationStyle="pageSheet"
Exception in HostFunction: MessageQueue is not empty
at validateEmptyMessageQueue (native)
417 | require('react-native/src/private/testing/fantom/specs/NativeFantom').default;
418 |
> 419 | NativeFantom.validateEmptyMessageQueue();
| ^
420 | }
421 |
422 | function serializeError(error: Error): FailureDetail {
at validateEmptyMessageQueue (private/react-native-fantom/runtime/setup.js:419:41)
at invokeHooks (private/react-native-fantom/runtime/setup.js:286:11)
at spec (private/react-native-fantom/runtime/setup.js:336:16)
at suite (private/react-native-fantom/runtime/setup.js:390:20)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at currentContext (private/react-native-fantom/runtime/setup.js:436:20)
at anonymous (private/react-native-fantom/runtime/setup.js:470:27)
```
The Modal Fantom test was failing in CI with "MessageQueue is not empty" error. This was caused by Modal's componentDidMount subscribing to ModalEventEmitter, which schedules work in the message queue. When Fantom's afterEach hook runs validateEmptyMessageQueue(), it detects pending work and fails the test.
Added Fantom.runWorkLoop() call at the end of the test to flush any pending messages in the queue before the test completes. This follows the established pattern used throughout the Fantom test suite for handling async operations.
Changelog: [Internal] Fix Fantom test
Differential Revision: D88538595
Summary:
Test was failing in CI with following error:
```
Summary of all failing tests
FAIL packages/react-native/Libraries/Modal/__tests__/Modal-itest.js (5.619 s)
● <Modal> (hermes) › props › presentationStyle › renders a Modal with presentationStyle="pageSheet"
Exception in HostFunction: MessageQueue is not empty
at validateEmptyMessageQueue (native)
417 | require('react-native/src/private/testing/fantom/specs/NativeFantom').default;
418 |
> 419 | NativeFantom.validateEmptyMessageQueue();
| ^
420 | }
421 |
422 | function serializeError(error: Error): FailureDetail {
at validateEmptyMessageQueue (private/react-native-fantom/runtime/setup.js:419:41)
at invokeHooks (private/react-native-fantom/runtime/setup.js:286:11)
at spec (private/react-native-fantom/runtime/setup.js:336:16)
at suite (private/react-native-fantom/runtime/setup.js:390:20)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at child (private/react-native-fantom/runtime/setup.js:374:33)
at suite (private/react-native-fantom/runtime/setup.js:388:22)
at currentContext (private/react-native-fantom/runtime/setup.js:436:20)
at anonymous (private/react-native-fantom/runtime/setup.js:470:27)
```
The Modal Fantom test was failing in CI with "MessageQueue is not empty" error.
Referencing other tests, added afterEach() to call `root.destroy()` for proper cleanup after each test.
Changelog: [Internal] Fix Fantom test
Differential Revision: D88538595
0b2e55e to
46d73bf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
meta-exported
p: Facebook
Partner: Facebook
Partner
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:
The Modal Fantom test was failing in CI with "MessageQueue is not empty" error. This was caused by Modal's componentDidMount subscribing to ModalEventEmitter, which schedules work in the message queue. When Fantom's afterEach hook runs validateEmptyMessageQueue(), it detects pending work and fails the test.
Added Fantom.runWorkLoop() call at the end of the test to flush any pending messages in the queue before the test completes. This follows the established pattern used throughout the Fantom test suite for handling async operations.
Changelog: [Internal] Fix Fantom test
Differential Revision: D88538595