Skip to content

feat(experimental): add order and jitter to fake timers - #11960

Draft
sheremet-va wants to merge 1 commit into
feat/seed-reportsfrom
feat/seeded-timers
Draft

sheremet-va wants to merge 1 commit into
feat/seed-reportsfrom
feat/seeded-timers

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Stacked on #11943.

Fake timers that are due at the same time run in the order of creation, and each timer runs exactly on time. Real timers do not. 2 new options take the order and the delays from the seed of the test, so repeats tests other schedules and --replay-seed repeats a failed one:

  • order: 'random': timeouts and intervals that are due at the same time run in a seeded order.
  • jitter: n: each timer is 0 to n ms late.
test('an invalidation wins over a slow response', { repeats: 99 }, () => {
  vi.useFakeTimers({ order: 'random', jitter: 10 })
  // ...
})

@sheremet-va
sheremet-va added this pull request to stack #11934 November 13, 2026 15:05
@netlify

netlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 6b6e9da
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6b06bb647f75d7516b91855e
😎 Deploy Preview https://deploy-preview-11960--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@flakiness-io

flakiness-io Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Test Results Summary

This comment shows the latest test results for this pull request.

Commit Status Test Results CI Runs
6b6e9da ❌ Failed 1 regressed · 33446 passed · 237 flaky · 1197 skipped 30 runs

1 regressed

🔥 win 10.0.26100 · vitest test/browser/specs/locators.test.ts:43 › custom locators work

⚠️ 237 flaky

⚠️ Ubuntu 26.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · vmThreads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ win 10.0.26100 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · forks test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · threads test/unit/test/retry.test.ts:55 › describe object add(1, 1) › returned value not be greater than 2
⚠️ Ubuntu 26.04 · vmThreads test/unit/test/retry.test.ts:61 › describe object add(1, 1) › returned value not be less than 2
…and 227 more

View full report

ℹ️ About Flakiness.io in GitHub

Your team has set up Flakiness.io pull request comments. This comment is updated when

  • The first test results arrive for this pull request
  • A later run reports more results for the same commit
  • A new commit is pushed and tested

Flakiness.io rewrites the comment in place, so it always reflects the most recently tested commit.

@sheremet-va
sheremet-va marked this pull request as draft November 18, 2026 13:58
@sheremet-va
sheremet-va force-pushed the feat/seeded-timers branch 2 times, most recently from 8961fc1 to c999e3f Compare November 19, 2026 18:02
@sheremet-va
sheremet-va force-pushed the feat/seeded-timers branch 2 times, most recently from 4e455b5 to 78b7c27 Compare November 24, 2026 22:28

This branch has not been deployed

No deployments
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.

1 participant