Fix flaky Modal-itest by adding proper root cleanup#55712
Closed
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Closed
Fix flaky Modal-itest by adding proper root cleanup#55712sammy-SC wants to merge 1 commit intofacebook:mainfrom
sammy-SC wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: changelog: [Internal] The Modal tests are flaky because message queue is sometimes not empty, leading to error: "MessageQueue is not empty". The fix adds beforeEach/afterEach hooks to create a fresh root for each test and properly destroy it afterwards. The root.destroy() call flushes the message queue, ensuring cleanup happens before the next test. I am not 100% sure why this happens, especially in multithreading environment. But this makes the situation less bad and tests less flaky. It does not address the root cause. Reviewed By: cipolleschi Differential Revision: D92171933
79987f2 to
2880433
Compare
Collaborator
|
This pull request was successfully merged by @sammy-SC in bd4eee2 When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been merged in bd4eee2. |
cortinico
pushed a commit
that referenced
this pull request
Feb 27, 2026
Summary: Pull Request resolved: #55712 changelog: [Internal] The Modal tests are flaky because message queue is sometimes not empty, leading to error: "MessageQueue is not empty". The fix adds beforeEach/afterEach hooks to create a fresh root for each test and properly destroy it afterwards. The root.destroy() call flushes the message queue, ensuring cleanup happens before the next test. I am not 100% sure why this happens, especially in multithreading environment. But this makes the situation less bad and tests less flaky. It does not address the root cause. Reviewed By: cipolleschi Differential Revision: D92171933 fbshipit-source-id: 0b931771475c9b65fe287ab06d1652d7d5d7efab
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: facebook#55712 changelog: [Internal] The Modal tests are flaky because message queue is sometimes not empty, leading to error: "MessageQueue is not empty". The fix adds beforeEach/afterEach hooks to create a fresh root for each test and properly destroy it afterwards. The root.destroy() call flushes the message queue, ensuring cleanup happens before the next test. I am not 100% sure why this happens, especially in multithreading environment. But this makes the situation less bad and tests less flaky. It does not address the root cause. Reviewed By: cipolleschi Differential Revision: D92171933 fbshipit-source-id: 0b931771475c9b65fe287ab06d1652d7d5d7efab
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:
changelog: [internal]
The Modal tests are flaky because message queue is sometimes not empty, leading to error: "MessageQueue is not empty".
The fix adds beforeEach/afterEach hooks to create a fresh root for each test and properly destroy it afterwards. The root.destroy() call flushes the message queue, ensuring cleanup happens before the next test.
I am not 100% sure why this happens, especially in multithreading environment. But this makes the situation less bad and tests less flaky. It does not address the root cause.
Reviewed By: cipolleschi
Differential Revision: D92171933