Skip to content

fix(js): move jest retry config to runtime setup file#2733

Merged
John Kennedy (jkennedyvz) merged 1 commit intomainfrom
fix/jest-retry-config
Apr 17, 2026
Merged

fix(js): move jest retry config to runtime setup file#2733
John Kennedy (jkennedyvz) merged 1 commit intomainfrom
fix/jest-retry-config

Conversation

@jkennedyvz
Copy link
Copy Markdown
Contributor

@jkennedyvz John Kennedy (jkennedyvz) commented Apr 17, 2026

Summary

  • Main went red after the integration test run in release(py,js): py 0.7.32, js 0.5.20 #2721 hit a transient 429 from the API and didn't retry.
  • Jest was printing validation warnings (Unknown option "retryTimes", Unknown option "retryImmediately") because these were added to jest.config.cjs but aren't valid Jest 29 config options:
    • retryTimes is a runtime API (jest.retryTimes(n)), not a config key.
    • retryImmediately is a Vitest option and doesn't exist in Jest at all.
    • Jest silently ignored both, so integration tests never retried.
  • Move the retry setup into a new js/jest.setup.cjs wired via setupFilesAfterEnv, calling jest.retryTimes(3, { logErrorsBeforeRetry: true }). retryImmediately: false is dropped — it has no Jest equivalent and was already a no-op.

Test plan

  • Running jest against a no-match pattern no longer emits the two Validation Warning: Unknown option blocks.
  • CI integration test run on this PR completes without the validation warnings and retries a flaky rate-limited test.

`retryTimes` and `retryImmediately` are not valid Jest 29 config
options — `retryTimes` is a runtime API (`jest.retryTimes(n)`) and
`retryImmediately` only exists in Vitest. Jest was logging validation
warnings and silently ignoring both, so flaky integration tests
never retried and transient 429s from the API broke main.

Call `jest.retryTimes(3, { logErrorsBeforeRetry: true })` from a
new `jest.setup.cjs` loaded via `setupFilesAfterEnv`, which is the
supported way to configure retries in Jest.
@jkennedyvz John Kennedy (jkennedyvz) merged commit ce9e9e8 into main Apr 17, 2026
28 checks passed
@jkennedyvz John Kennedy (jkennedyvz) deleted the fix/jest-retry-config branch April 17, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants