Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the js tests action to retry it up to 3 times if tests fail for the first time #10203

Open
1 task
eugene-manuilov opened this issue Feb 11, 2025 · 4 comments
Labels
Good First Issue Good first issue for new engineers P2 Low priority QA: Eng Requires specialized QA by an engineer Type: Infrastructure Engineering infrastructure & tooling

Comments

@eugene-manuilov
Copy link
Collaborator

eugene-manuilov commented Feb 11, 2025

Feature Description

Our js tests tend to fail on a random basis caused by some sporadic timeouts that is hard to troubleshoot and fix. We need to repeat failed tests on failure to increase the chance of passing js tests without a need to manually restart it.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • JS tests retries up to 3 times if the first run fails
  • Subsequent runs check only failed tests

Implementation Brief

  • Update jest tests step
    - name: Jest Tests
    run: npm run test:js
    • Remove the run command
    • Add uses: nick-fields/retry@v3 with the following properties (docs):
      • max_attempts: 3
      • timeout_minutes: 15
      • command: "npm run test:js"
      • retry_on: error
      • retry_wait_seconds: 0
      • new_command_on_retry: "npm run test:js -- --onlyFailures"

Test Coverage

  • N/A

QA Brief

Changelog entry

@eugene-manuilov eugene-manuilov added Good First Issue Good first issue for new engineers P2 Low priority Type: Infrastructure Engineering infrastructure & tooling labels Feb 11, 2025
@eugene-manuilov
Copy link
Collaborator Author

@aaemnnosttv @tofumatt @nfmohit @techanvil do you mind reviewing IB?

@techanvil techanvil self-assigned this Feb 11, 2025
@techanvil
Copy link
Collaborator

Sure, @eugene-manuilov, this is looking good. A couple of small points:

  • The docs for nick-fields/retry@v3 state that retry_wait_seconds has a default of 10. I don't think we need to wait 10 seconds to retry, so would suggest we provide a lower value for this setting.
  • The docs don't have the commands quoted - I'm not sure if it makes a difference but would suggest updating to e.g. command: npm run test:js for consistency with the docs.

@eugene-manuilov
Copy link
Collaborator Author

  • The docs for nick-fields/retry@v3 state that retry_wait_seconds has a default of 10. I don't think we need to wait 10 seconds to retry, so would suggest we provide a lower value for this setting.

Nicely spotted. Updated IB to wait 0 seconds between retries.

  • The docs don't have the commands quoted - I'm not sure if it makes a difference but would suggest updating to e.g. command: npm run test:js for consistency with the docs.

The commands are quoted to escape colons that we have there. This is yaml stuff. Might not be really necessary, but better to use it to escape strings just in case.

@techanvil
Copy link
Collaborator

Thanks @eugene-manuilov. Good point, the commands should simply be treated as strings either way so quoting should be OK.

IB ✅

@techanvil techanvil removed their assignment Feb 12, 2025
@eugene-manuilov eugene-manuilov added the QA: Eng Requires specialized QA by an engineer label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good first issue for new engineers P2 Low priority QA: Eng Requires specialized QA by an engineer Type: Infrastructure Engineering infrastructure & tooling
Projects
None yet
Development

No branches or pull requests

2 participants