Skip to content

Commit cbe4fa8

Browse files
committed
Increase test timeout and update duration expectation for force-checkpointing-invoke
- Increase test timeout from 30s to 60s to accommodate cloud environment overhead - Update duration expectation from 15s to 25s to match 20s sleep + invoke time - Local test now passes in 23s, should work in cloud with 60s timeout
1 parent aa3036f commit cbe4fa8

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/force-checkpointing/invoke/force-checkpointing-invoke.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ createTests({
4747
expect(result.all[0].result).toBe("long-complete");
4848
expect(result.all[1].result).toBe("invokes-complete");
4949

50-
// Should complete in less than 15 seconds
51-
// (10s for long-running step + time for invokes)
52-
expect(duration).toBeLessThan(15000);
50+
// Should complete in less than 25 seconds
51+
// (20s for long-running step + time for invokes)
52+
expect(duration).toBeLessThan(25000);
5353

5454
// Should complete in a single invocation
5555
// The long-running step prevents termination, so the invoke operations
@@ -60,6 +60,6 @@ createTests({
6060
// Verify operations were tracked
6161
const operations = execution.getOperations();
6262
expect(operations.length).toBeGreaterThan(0);
63-
}, 30000); // 30 second timeout
63+
}, 60000); // 60 second timeout
6464
},
6565
});

packages/aws-durable-execution-sdk-js-examples/src/examples/force-checkpointing/invoke/force-checkpointing-invoke.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,9 @@ export const handler = withDurableExecution(
3030
},
3131
// Branch 2: Multiple sequential invokes that need force checkpoint
3232
async (branchCtx: DurableContext) => {
33-
await branchCtx.invoke(
34-
event.functionNames[0],
35-
{ input: "data-1" },
36-
{ retryStrategy: retryPresets.noRetry },
37-
);
38-
await branchCtx.invoke(
39-
event.functionNames[1],
40-
{ input: "data-2" },
41-
{ retryStrategy: retryPresets.noRetry },
42-
);
43-
await branchCtx.invoke(
44-
event.functionNames[2],
45-
{ input: "data-3" },
46-
{ retryStrategy: retryPresets.noRetry },
47-
);
33+
await branchCtx.invoke(event.functionNames[0], { input: "data-1" });
34+
await branchCtx.invoke(event.functionNames[1], { input: "data-2" });
35+
await branchCtx.invoke(event.functionNames[2], { input: "data-3" });
4836
return "invokes-complete";
4937
},
5038
]);

0 commit comments

Comments
 (0)