Fix Modal Fantom test#54811
Closed
alanleedev wants to merge 1 commit into
Closed
Conversation
|
@alanleedev has exported this pull request. If you are a Meta employee, you can view the originating Diff in D88538595. |
cf26dad to
eba64a4
Compare
548788e to
0b2e55e
Compare
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
Collaborator
|
Closing this PR as the diff D88538595 has been abandoned internally. |
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.
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