Skip to content

[vitest-pool-workers] add disableRetryDelays() to skip retry backoff delays in workflow tests#12858

Merged
pombosilva merged 2 commits intocloudflare:mainfrom
repository:lngo/vitest-pool-skip-retry-delays
Mar 30, 2026
Merged

[vitest-pool-workers] add disableRetryDelays() to skip retry backoff delays in workflow tests#12858
pombosilva merged 2 commits intocloudflare:mainfrom
repository:lngo/vitest-pool-skip-retry-delays

Conversation

@repository
Copy link
Copy Markdown
Member

@repository repository commented Mar 11, 2026

when testing a workflow step that has retry configuration, the backoff between retries will actually take effect even when the step results are full mocked, and burn real wall-time for no reason. this behavior still persists even when disableSleeps() is called on the workflow.

this changes adds a new method disableRetryDelays() to WorkflowInstanceModifier, similar to disableSleeps(), which will cause the retry to occur immediately instead of after the configured backoff time. this can also be done to only specific steps as well.

 // disable all retry delays
 await instance.modify(m => m.disableRetryDelays());

 // disable for specific steps only
 await instance.modify(m => {
   m.disableRetryDelays([{ name: "go take a nap and eat a sandwich" }]);
 });

A picture of a cute animal (not mandatory, but encouraged)

image a cat i saw outside of the austin office last summer
Open with Devin

@repository repository requested review from a team as code owners March 11, 2026 22:08
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 11, 2026

🦋 Changeset detected

Latest commit: 8228ce6

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workflows
  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/vitest-pool-workers/types/cloudflare-test.d.ts: [@cloudflare/wrangler]
  • packages/workflows-shared/src/context.ts: [@cloudflare/workflows @cloudflare/wrangler]
  • packages/workflows-shared/src/modifier.ts: [@cloudflare/workflows @cloudflare/wrangler]
  • packages/workflows-shared/tests/context.test.ts: [@cloudflare/workflows @cloudflare/wrangler]

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 12, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12858

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12858

miniflare

npm i https://pkg.pr.new/miniflare@12858

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12858

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12858

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12858

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12858

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12858

wrangler

npm i https://pkg.pr.new/wrangler@12858

commit: 8228ce6

@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch from d3e4566 to 745c840 Compare March 17, 2026 19:14
@workers-devprod
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/workflows
  • @cloudflare/wrangler
Show detailed file reviewers
  • packages/vitest-pool-workers/types/cloudflare-test.d.ts: [@cloudflare/wrangler]
  • packages/workflows-shared/src/context.ts: [@cloudflare/workflows @cloudflare/wrangler]
  • packages/workflows-shared/src/modifier.ts: [@cloudflare/workflows @cloudflare/wrangler]
  • packages/workflows-shared/tests/context.test.ts: [@cloudflare/workflows @cloudflare/wrangler]

@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch 3 times, most recently from 5189f12 to 3fed9d5 Compare March 26, 2026 16:04
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Mar 26, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/workflows
  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch from 3fed9d5 to 923f861 Compare March 26, 2026 16:07
devin-ai-integration[bot]

This comment was marked as resolved.

@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch from 923f861 to ecf14c4 Compare March 26, 2026 19:33
Copy link
Copy Markdown
Contributor

@pombosilva pombosilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left a few comments

Can you also add the usage of this new handler to fixtures/vitest-pool-workers-examples/workflows/?

Comment thread packages/workflows-shared/src/modifier.ts Outdated
Comment thread packages/vitest-pool-workers/types/cloudflare-test.d.ts
Comment thread packages/vitest-pool-workers/types/cloudflare-test.d.ts
Comment thread packages/workflows-shared/tests/context.test.ts Outdated
Comment thread packages/workflows-shared/tests/context.test.ts Outdated
@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch 3 times, most recently from 8dd2fac to bdab160 Compare March 27, 2026 16:36
@repository repository force-pushed the lngo/vitest-pool-skip-retry-delays branch from bdab160 to a02fbaf Compare March 27, 2026 16:43
@pombosilva pombosilva self-requested a review March 27, 2026 16:53
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Mar 27, 2026
@pombosilva pombosilva merged commit f05f2da into cloudflare:main Mar 30, 2026
52 of 54 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Mar 30, 2026
NuroDev pushed a commit that referenced this pull request Mar 30, 2026
@repository repository deleted the lngo/vitest-pool-skip-retry-delays branch April 1, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants