Skip to content

Commit 509f504

Browse files
committed
Optimize failure threshold exceeded tests with retryPresets.noRetry
- Replace custom retry strategies with retryPresets.noRetry in map failure threshold exceeded tests - Eliminates unnecessary retry delays that were causing cloud integration test timeouts - Maintains test behavior while significantly reducing execution time
1 parent 8a946ed commit 509f504

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
DurableContext,
33
withDurableExecution,
4+
retryPresets,
45
} from "@aws/durable-execution-sdk-js";
56
import { ExampleConfig } from "../../../types";
67

@@ -25,14 +26,7 @@ export const handler = withDurableExecution(
2526
}
2627
return item * 2;
2728
},
28-
{
29-
retryStrategy: (error: Error, attemptCount: number) => {
30-
if (attemptCount >= 1) {
31-
return { shouldRetry: false };
32-
}
33-
return { shouldRetry: true, delay: { seconds: 1 } };
34-
},
35-
},
29+
{ retryStrategy: retryPresets.noRetry },
3630
);
3731
},
3832
{

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

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

@@ -26,14 +27,7 @@ export const handler = withDurableExecution(
2627
}
2728
return item * 2;
2829
},
29-
{
30-
retryStrategy: (error: Error, attemptCount: number) => {
31-
if (attemptCount >= 1) {
32-
return { shouldRetry: false };
33-
}
34-
return { shouldRetry: true, delay: { seconds: 1 } };
35-
},
36-
},
30+
{ retryStrategy: retryPresets.noRetry },
3731
);
3832
},
3933
{

0 commit comments

Comments
 (0)