Fix flaky tests #1131

Closed
opened 2026-04-05 16:25:29 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @xuebingli on 3/15/2024

Fix Flaky Tests

Diagnosis

TeamMemberService.test.ts contains flaky tests. The flakiness can be observed in both #1251 and #1252. Tests in both PRs fail, yet the failed tests have nothing to do with the code changes. I cannot reproduce the failed tests locally.

Upon investigation, the cause seems to be the slowness of GitHub Action runners, leading to tests exceeding Jest's default 5-second-long timeout.

The Fix

This PR increases the test timeout to 60 seconds for TeamMemberService.test.ts.

Pull Request Checklist:

  • Please make sure all jobs pass before requesting a review.
  • Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if such).
  • Have you lint your code locally before submission?
  • Did you write tests where appropriate?

https://github.com/OneUptime/oneuptime/pull/1254#issuecomment-1999121156

Screenshots (if appropriate):

N/A

*Originally created by @xuebingli on 3/15/2024* ## Fix Flaky Tests ### Diagnosis `TeamMemberService.test.ts` contains flaky tests. The flakiness can be observed in both #1251 and #1252. Tests in both PRs fail, yet the failed tests have nothing to do with the code changes. I cannot reproduce the failed tests locally. Upon investigation, the cause seems to be the slowness of GitHub Action runners, leading to tests exceeding Jest's default 5-second-long timeout. ### The Fix This PR increases the test timeout to 60 seconds for `TeamMemberService.test.ts`. ### Pull Request Checklist: - [x] Please make sure all jobs pass before requesting a review. - [x] Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). - [x] Have you lint your code locally before submission? - [x] Did you write tests where appropriate? ### Related Issue https://github.com/OneUptime/oneuptime/pull/1254#issuecomment-1999121156 ### Screenshots (if appropriate): N/A
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#1131