From 58ad31c3d33d3f5caf2dce938b5a157b068c99b8 Mon Sep 17 00:00:00 2001 From: lily Date: Wed, 11 Mar 2026 14:58:05 -0700 Subject: [PATCH] [workers] document disableRetryDelays() for workflow testing --- .../docs/workers/testing/vitest-integration/test-apis.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/workers/testing/vitest-integration/test-apis.mdx b/src/content/docs/workers/testing/vitest-integration/test-apis.mdx index fcb83721f99b67b..235e0aa3d1e2011 100644 --- a/src/content/docs/workers/testing/vitest-integration/test-apis.mdx +++ b/src/content/docs/workers/testing/vitest-integration/test-apis.mdx @@ -363,6 +363,7 @@ Available in `@cloudflare/vitest-pool-workers` version **0.9.0**! * `WorkflowInstanceModifier` * This object is provided to the `modify` and `modifyAll` callbacks to mock or alter the behavior of a Workflow instance's steps, events, and sleeps. * `disableSleeps(steps?: { name: string; index?: number }[])`: Disables sleeps, causing `step.sleep()` and `step.sleepUntil()` to resolve immediately. If `steps` is omitted, all sleeps are disabled. + * `disableRetryDelays(steps?: { name: string; index?: number }[])`: Disables retry backoff delays, causing retry attempts of a failing `step.do()` to execute immediately without waiting. The retries still happen — only the delay between them is removed. If `steps` is omitted, all retry delays are disabled. * `mockStepResult(step: { name: string; index?: number }, stepResult: unknown)`: Mocks the result of a `step.do()`, causing it to return the specified value instantly without executing the step's implementation. * `mockStepError(step: { name: string; index?: number }, error: Error, times?: number)`: Forces a `step.do()` to throw an error, simulating a failure. `times` is an optional number that sets how many times the step should error. If `times` is omitted, the step will error on every attempt, making the Workflow instance fail. * `forceStepTimeout(step: { name: string; index?: number }, times?: number)`: Forces a `step.do()` to fail by timing out immediately. `times` is an optional number that sets how many times the step should timeout. If `times` is omitted, the step will timeout on every attempt, making the Workflow instance fail. @@ -384,6 +385,9 @@ Available in `@cloudflare/vitest-pool-workers` version **0.9.0**! // Disables all sleeps to make the test run instantly await m.disableSleeps(); + // Disables retry backoff delays so retries execute without waiting + await m.disableRetryDelays(); + // Mocks the successful result of a data-fetching step await m.mockStepResult( { name: "get-order-details" },