Skip to content

[Due for payment 2026-06-25] Investigate workflow job failing on main: test / test (job 6) #93818

Closed

Description

@github-actions

🚨 Failure Summary 🚨:

  • 📋 Job Name: test / test (job 6)
  • 🔧 Failure in Workflow: Process new code merged to main
  • 🔗 Triggered by PR: PR Link
  • 👤 PR Author: @KJ21-ENG
  • 🤝 Merged by: @Gonals
  • 🐛 Error Message:
    warning: [git-mirror] Skipping cache commit: Found 2 failed/cancelled steps
    warning: [git-mirror] - Step: unknown (failed)
    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 6).
🔍 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. Gonals commented on Jun 17, 2026

    @Gonals
    Contributor

    @MelvinBot investigate

  2. MelvinBot commented on Jun 17, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: This is a flaky test, not a real regression from PR #93163. That PR only touched src/hooks/useSearchBulkActions.ts (2 lines), which has nothing to do with the failing test tests/unit/selectors/PolicyTest.ts. The merge just happened to be the main run where the random seed tripped the flake.

    The test createOwnedPaidPoliciesCountsSelector › excludes policies pending deletion from active count but includes them in total builds policy1 with createRandomPolicy(...) and expects it to be counted as active. But the factory assigns a random pendingAction (policies.ts:32):

    pendingAction: rand(Object.values(CONST.RED_BRICK_ROAD_PENDING_ACTION)),

    RED_BRICK_ROAD_PENDING_ACTION has 3 values — ADD, DELETE, UPDATE — so roughly 1 in 3 runs policy1 gets pendingAction: 'delete'. The selector counts active as !isPendingDeletePolicy(policy) (Policy.ts:38), so a randomly-deleted policy1 drops active from the expected 1 to 0 — exactly the failure (Expected active: 1, Received active: 0).

    Recommended Fix: In PolicyTest.ts, explicitly pin pendingAction for any policy that must be counted as active, so the factory's random value can't make it pending-deletion. Two tests are affected:

    Investigation details
    • Failing job: test / test (job 6). Result: Test Suites: 1 failed, Tests: 1 failed. Only PolicyTest.ts failed; typecheck and lint passed.
    • PR Fix unreported expense export payload #93163 diff = src/hooks/useSearchBulkActions.ts only. No overlap with the selector or the policy test factory → rules out a causal regression.
    • The factory has assigned a random pendingAction for a while; this test is simply a pre-existing flake that surfaces ~1/3 of the time. Re-running the job would likely pass, which is why this reads as a non-deterministic failure rather than a deploy blocker.

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement this to create a draft PR pinning pendingAction in the two affected tests.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.

  3. KJ21-ENG commented on Jun 17, 2026

    @KJ21-ENG
    Contributor

    I checked this against PR #93163. The merged diff only changes src/hooks/useSearchBulkActions.ts for the unreported expense export payload.

    The failing post-merge job is tests/unit/selectors/PolicyTest.ts, specifically createOwnedPaidPoliciesCountsSelector, expecting {total: 2, active: 1} but receiving {total: 2, active: 0}. That policy selector path is unrelated to the export payload change.

    Also, the PR’s own pre-merge test (job 6) passed and PolicyTest.ts passed in that run. This looks like an unrelated main/post-merge failure rather than a regression from #93163.

  4. Gonals commented on Jun 17, 2026

    @Gonals
    Contributor

    @MelvinBot implement this

  5. MelvinBot commented on Jun 17, 2026

    @MelvinBot
    Contributor

    🤖 Draft PR created: #93823
    Please mark it as "Ready for review" when it is ready for review.

    ⚠️ Note: I couldn't run the jest/npm test suite locally (the runner is blocked in my sandbox), so please rely on the CI test check to confirm the fix. The change is deterministic and test-only.

  6. Gonals commented on Jun 17, 2026

    @Gonals
    Contributor

    Fixed. Should be good now

  7. changed the title [-]Investigate workflow job failing on main: test / test (job 6)[/-] [+][Due for payment 2026-06-25] Investigate workflow job failing on main: test / test (job 6)[/+] on Jun 18, 2026
  8. melvin-bot commented on Jun 18, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  9. melvin-bot commented on Jun 18, 2026

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2026-06-25. 🎊

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