Skip to content

Investigate workflow job failing on main: test / test (job 7) #103714

Closed

Description

@github-actions

🚨 Failure Summary 🚨:

  • 📋 Job Name: test / test (job 7)
  • 🔧 Failure in Workflow: Process new code merged to main
  • 🔗 Triggered by PR: PR Link
  • 👤 PR Author: @sumo-slonik
  • 🤝 Merged by: @grgia
  • 🐛 Error Message:
    warning: Skipping sticky disk commit due to previous step failures
    warning: - Step: unknown (failed)
    warning: Found 2 failed/cancelled steps in previous workflow steps
    failure: Process completed with exit code 1.

⚠️ Action Required ⚠️:

🛠️ A recent merge appears to have caused a failure in the job named test / test (job 7).
🔍 This issue has been automatically created and labeled with Workflow Failure for investigation.

👀 Please look into the following:

  1. Why the PR caused the job to fail?
  2. Address any underlying issues.

For detailed instructions, check this SO.

🐛 We appreciate your help in squashing this bug!

Activity

  1. paulnjs commented on Oct 12, 2026

    @paulnjs
    Contributor

    Proposal

    What is the root cause of that problem?

    The failure Expected: "101" Received: undefined comes from the assertion reading the wrong requestMoney call. Report 101 is in Onyx, and this page's own press sends it.

    resolveReportForMoneyRequest returns the route report when the transaction report is loaded but not usable and the two ids match. Here the draft's reportID and the route report are both "101", and that report is submitted, so it is not usable as the transaction report. Because the ids match, the function falls through to the route report instead of returning undefined for a differing id. If report 101 itself is missing, the route report is undefined, so that is what the function returns. The Create button does not wait for report 101; it only needs the draft. The submit then keeps whatever report that render had, because it runs inside requestAnimationFrame.

    Running the whole file showed a second, earlier call. The previous test's confirm is still scheduled. That test is should not fallback to route report when transaction report differs and is not usable: its route is "100", its transaction report is "200", and its own assertion expects no report. A slow flush, such as the 1s act or a busy CI worker, runs that callback after clearAllMocks and before this page renders. That call goes through useRequestMoneySubmission with no report. The recorded order was:

    1. requestMoney with no report, before this page resolves anything.
    2. This page resolves the route report "101".
    3. This page's Create press calls requestMoney with report "101".

    mock.calls.at(0) is call 1, so the assertion sees undefined. A single-test run never has that leftover call, which is why it passes on its own. Reading the report back from Onyx before render passes for the same reason: the stored value is already "101".

    What changes do you think we should make to solve the problem?

    The test now waits until report 101 is both stored and resolved, then asserts only the call from this press.
    mockClear() drops the leftover call before the press.

    fireEvent.press(await screen.findByText(getConfirmButtonRegex()));

    jest.mocked(TrackExpense.requestMoney).mockClear();
    fireEvent.press(await screen.findByText(getConfirmButtonRegex()));
    await act(async () => {
        await new Promise<void>((resolve) => {
            setTimeout(() => {
                void Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${routeReportID}`, {
                    reportID: routeReportID,
                    policyID: POLICY_ID,
                    type: CONST.REPORT.TYPE.CHAT,
                    stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
                    statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
                }).then(() => resolve());
            }, 1000);
        });
    });

    What alternative solutions did you explore? (Optional)

    N/A

  2. grgia commented on Oct 12, 2026

    @grgia
    Contributor

    Flaky test, not either PR. The untouched-scan test ends before its 3s GPS fallback submits, so that stray requestMoney lands in whichever test runs next. Fix in #103747

  3. grgia commented on Oct 15, 2026

    @grgia
    Contributor

    PR in review #103747

  4. melvin-bot commented on Oct 19, 2026

    @melvin-bot

    @grgia

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.13-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions