Skip to content

Fix flaky fetch call-count assertions in MiddlewareTest#91620

Closed
duongynhi000005-oss wants to merge 1 commit into
Expensify:mainfrom
duongynhi000005-oss:agent3/fix-middleware-flake
Closed

Fix flaky fetch call-count assertions in MiddlewareTest#91620
duongynhi000005-oss wants to merge 1 commit into
Expensify:mainfrom
duongynhi000005-oss:agent3/fix-middleware-flake

Conversation

@duongynhi000005-oss

@duongynhi000005-oss duongynhi000005-oss commented May 25, 2026

Copy link
Copy Markdown

Summary

Stabilize two flaky HandleUnusedOptimisticID test cases by waiting for global.fetch to reach the expected call count before asserting.

Changes

  • Added waitForFetchCallCount() helper in tests/unit/MiddlewareTest.ts.
  • Replaced direct toHaveBeenCalledTimes(2) assertions in the two flaky tests with await waitForFetchCallCount(2).

Testing

  • Not run locally in this environment.

$ #90660

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi @duongynhi000005-oss, thanks for your interest in contributing to Expensify!

This PR has been automatically closed because it doesn't appear to meet our contribution requirements:

  • You are not a member of the Expensify GitHub organization
  • No linked GitHub issue was found in the PR description where you are listed as an assignee
  • No linked GitHub PR was found in the PR description where you are the author or a reviewer

If you'd like to contribute, please make sure to:

  1. Find an open issue you'd like to work on
  2. Get assigned to the issue by following our contribution process
  3. Link the issue in your PR description using the format: $ https://github.com/Expensify/App/issues/<issueID>

Please review our contributing guidelines for more details.

If you believe this was closed in error, please reach out in the #expensify-open-source Slack channel.

@github-actions github-actions Bot closed this May 25, 2026
@github-actions github-actions Bot locked as spam and limited conversation to collaborators May 25, 2026
@melvin-bot melvin-bot Bot requested review from inimaga and removed request for a team May 25, 2026 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant