Skip to content

Commit df40701

Browse files
committed
Use createRetryStrategy for failure threshold exceeded tests
- Replace retryPresets.noRetry with createRetryStrategy({ maxAttempts: 1 }) - Ensures proper retry strategy configuration for immediate failure - Maintains fast execution while using the correct retry helper function
1 parent 509f504 commit df40701

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/map/failure-threshold-exceeded-count/map-failure-threshold-exceeded-count.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4-
retryPresets,
4+
createRetryStrategy,
55
} from "@aws/durable-execution-sdk-js";
66
import { ExampleConfig } from "../../../types";
77

@@ -26,7 +26,7 @@ export const handler = withDurableExecution(
2626
}
2727
return item * 2;
2828
},
29-
{ retryStrategy: retryPresets.noRetry },
29+
{ retryStrategy: createRetryStrategy({ maxAttempts: 1 }) },
3030
);
3131
},
3232
{
@@ -36,8 +36,6 @@ export const handler = withDurableExecution(
3636
},
3737
);
3838

39-
await context.wait({ seconds: 1 });
40-
4139
return {
4240
completionReason: result.completionReason,
4341
successCount: result.successCount,

packages/aws-durable-execution-sdk-js-examples/src/examples/map/failure-threshold-exceeded-percentage/map-failure-threshold-exceeded-percentage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4-
retryPresets,
4+
createRetryStrategy,
55
} from "@aws/durable-execution-sdk-js";
66
import { ExampleConfig } from "../../../types";
77

@@ -27,7 +27,7 @@ export const handler = withDurableExecution(
2727
}
2828
return item * 2;
2929
},
30-
{ retryStrategy: retryPresets.noRetry },
30+
{ retryStrategy: createRetryStrategy({ maxAttempts: 1 }) },
3131
);
3232
},
3333
{

0 commit comments

Comments
 (0)