[No QA] Fix flaky SignInBackButtonTest - #98579
Conversation
|
@MelvinBot investigate all workflow failures |
Workflow failures — all infrastructure, none from this PRAll three failing checks died from the same CI runner failure, not your code:
The job logs are all Your fix is fine. The flaky
Recommendation: Re-run the failed jobs — I don't have permission to trigger re-runs here, so please kick them off: gh run rerun 31700363252 --repo Expensify/App --failed # ESLint
gh run rerun 31700363292 --repo Expensify/App --failed # test (jobs 2 & 7)They should go green on a healthy runner with no changes needed. |
|
Fixed in #98586 |
Explanation of Change
tests/unit/SignInBackButtonTest.tsx(added in #98401) is flaky and is currently failing on most open PRs, e.g. https://github.com/Expensify/App/actions/runs/31686180988/job/94402673478:Root cause:
@libs/Navigation/Navigationwith onlygoBackandnavigationRef.SignInModalruns an effect that ends inopenApp(true)(the mockeduseSessionreturnsundefined, so the user is treated as non-anonymous andhasSignedInRefis set).openAppissues a realOpenApprequest.jest/setup.tsinstalls a globalfetchmock that resolves{jsonCode: 200}, so the request succeeds andfinallyDatamergesIS_LOADING_APP: false.isLoadingApp !== falseguard now passes, and it callsNavigation.dismissModal()— which the mock doesn't define →TypeError.Whether that round trip lands before the test file finishes is a race, which is why the same shard (
test (job 1), 2799 tests) passes in some runs and fails in others with no change onmainin between:Fix:
openAppso the unit test doesn't fire a real API request whose response lands mid-test (this also removes leaked async work — the failing job logs "A worker process has failed to exit gracefully").Navigationmock with the membersSignInModal/SignInPageactually use (dismissModal,navigate,isNavigationReady), so the test can't break again on timing alone.The assertions themselves are unchanged, so the regression coverage added by #98401 for #96869 is preserved.
Fixed Issues
$ N/A — CI-only fix for the flaky test added in #98401
Tests
N/A
Offline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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.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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari