Repository navigation
[No QA] Fix flaky PaginationTest job 4 timeout - #92584
Conversation
Align the post-render Onyx merges in signInAndGetApp() with the UnreadIndicatorsTest pattern: issue merges as a bare Promise.all and let the final waitForBatchedUpdatesWithAct drain them, rather than wrapping them in act() which forces a synchronous React flush that is significantly slower under CI coverage instrumentation. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@QichenZhu Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/Videos (N/A)
|
Codecov Report✅ All modified and coverable lines are covered by tests. |
QichenZhu
left a comment
There was a problem hiding this comment.
The performance didn't improve much in my testing, but it didn't regress either, and the code is simpler, so I'm good with this change.
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.0-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀
|






Explanation of Change
tests/ui/PaginationTest.tsx › opens a chat and load initial messagesintermittently times out at 120s on CI (job 4). The test itself is not broken — it is genuinely slow because it mounts a full<App />per test with lazy-loaded React Navigation screens.The specific bottleneck:
signInAndGetApp()wraps the 5 post-render Onyx merges inact(async () => Promise.all([...])). Theact()boundary forces React to flush all pending updates synchronously before the act resolves. Under CI with--coverageinstrumentation and 6 concurrent Jest workers, this synchronous flush is significantly more expensive than a deferred drain.This PR aligns
signInAndGetApp()with the established pattern used byUnreadIndicatorsTest.signInAndGetAppWithUnreadChat(): issue the merges as a barePromise.alland let the existingwaitForBatchedUpdatesWithAct()at the end drain them in one pass. No merges are moved pre-render and no timeout is changed — both are consistent with every peer full-App test in the codebase.Local results after the change (single worker, no coverage):
opens a chat and load initial messages: ~95–108s (vs timing out on CI)opens a chat and load older messages: ~800msopens a chat and load newer messages: ~1.6sFixed Issues
$ #92493
Tests
npx jest tests/ui/PaginationTest.tsx --no-cachePaginationdescribe block pass with no timeoutsOffline tests
N/A — test infrastructure only; no offline behavior changed.
QA Steps
N/A — [No QA]. Test-only change; no production code or user-visible behavior changed.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — no UI changes (test infrastructure only).
Android: mWeb Chrome
N/A — no UI changes (test infrastructure only).
iOS: Native
N/A — no UI changes (test infrastructure only).
iOS: mWeb Safari
N/A — no UI changes (test infrastructure only).
MacOS: Chrome / Safari
N/A — no UI changes (test infrastructure only).