Skip to content

Commit 5469c9f

Browse files
committed
add checkpoint delay for min-successful tests due to bug
1 parent 2cece1c commit 5469c9f

File tree

4 files changed

+261
-90
lines changed

4 files changed

+261
-90
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/map/min-successful/map-min-successful.history.json

Lines changed: 143 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
"EventType": "ExecutionStarted",
44
"EventId": 1,
5-
"Id": "9d245077-e425-42f8-a8b5-521cac34e9d2",
6-
"EventTimestamp": "2025-12-10T00:12:31.901Z",
5+
"Id": "023ef399-731b-47ff-88cb-046d628ad1a4",
6+
"EventTimestamp": "2025-12-11T23:34:27.714Z",
77
"ExecutionStartedDetails": {
88
"Input": {
99
"Payload": "{}"
@@ -16,7 +16,7 @@
1616
"EventId": 2,
1717
"Id": "c4ca4238a0b92382",
1818
"Name": "min-successful-items",
19-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
19+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
2020
"ContextStartedDetails": {}
2121
},
2222
{
@@ -25,7 +25,7 @@
2525
"EventId": 3,
2626
"Id": "ea66c06c1e1c05fa",
2727
"Name": "map-item-0",
28-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
28+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
2929
"ParentId": "c4ca4238a0b92382",
3030
"ContextStartedDetails": {}
3131
},
@@ -35,7 +35,7 @@
3535
"EventId": 4,
3636
"Id": "2f221a18eb863803",
3737
"Name": "process-0",
38-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
38+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
3939
"ParentId": "ea66c06c1e1c05fa",
4040
"StepStartedDetails": {}
4141
},
@@ -45,7 +45,7 @@
4545
"EventId": 5,
4646
"Id": "98c6f2c2287f4c73",
4747
"Name": "map-item-1",
48-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
48+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
4949
"ParentId": "c4ca4238a0b92382",
5050
"ContextStartedDetails": {}
5151
},
@@ -55,7 +55,7 @@
5555
"EventId": 6,
5656
"Id": "6151f5ab282d90e4",
5757
"Name": "process-1",
58-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
58+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
5959
"ParentId": "98c6f2c2287f4c73",
6060
"StepStartedDetails": {}
6161
},
@@ -65,7 +65,7 @@
6565
"EventId": 7,
6666
"Id": "13cee27a2bd93915",
6767
"Name": "map-item-2",
68-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
68+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
6969
"ParentId": "c4ca4238a0b92382",
7070
"ContextStartedDetails": {}
7171
},
@@ -75,7 +75,7 @@
7575
"EventId": 8,
7676
"Id": "b425e0c75591aa8f",
7777
"Name": "process-2",
78-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
78+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
7979
"ParentId": "13cee27a2bd93915",
8080
"StepStartedDetails": {}
8181
},
@@ -85,7 +85,7 @@
8585
"EventId": 9,
8686
"Id": "3a170a9fe4f47efa",
8787
"Name": "map-item-3",
88-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
88+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
8989
"ParentId": "c4ca4238a0b92382",
9090
"ContextStartedDetails": {}
9191
},
@@ -95,7 +95,7 @@
9595
"EventId": 10,
9696
"Id": "a4e1cd317d54f087",
9797
"Name": "process-3",
98-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
98+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
9999
"ParentId": "3a170a9fe4f47efa",
100100
"StepStartedDetails": {}
101101
},
@@ -105,7 +105,7 @@
105105
"EventId": 11,
106106
"Id": "12426c956d1bc501",
107107
"Name": "map-item-4",
108-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
108+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
109109
"ParentId": "c4ca4238a0b92382",
110110
"ContextStartedDetails": {}
111111
},
@@ -115,7 +115,7 @@
115115
"EventId": 12,
116116
"Id": "0f42756e5788f9b0",
117117
"Name": "process-4",
118-
"EventTimestamp": "2025-12-10T00:12:31.906Z",
118+
"EventTimestamp": "2025-12-11T23:34:28.459Z",
119119
"ParentId": "12426c956d1bc501",
120120
"StepStartedDetails": {}
121121
},
@@ -125,7 +125,7 @@
125125
"EventId": 13,
126126
"Id": "2f221a18eb863803",
127127
"Name": "process-0",
128-
"EventTimestamp": "2025-12-10T00:12:32.005Z",
128+
"EventTimestamp": "2025-12-11T23:34:29.176Z",
129129
"ParentId": "ea66c06c1e1c05fa",
130130
"StepSucceededDetails": {
131131
"Result": {
@@ -135,55 +135,142 @@
135135
}
136136
},
137137
{
138-
"EventType": "ContextSucceeded",
139-
"SubType": "MapIteration",
138+
"EventType": "StepSucceeded",
139+
"SubType": "Step",
140140
"EventId": 14,
141-
"Id": "ea66c06c1e1c05fa",
142-
"Name": "map-item-0",
143-
"EventTimestamp": "2025-12-10T00:12:32.007Z",
144-
"ParentId": "c4ca4238a0b92382",
145-
"ContextSucceededDetails": {
141+
"Id": "6151f5ab282d90e4",
142+
"Name": "process-1",
143+
"EventTimestamp": "2025-12-11T23:34:29.176Z",
144+
"ParentId": "98c6f2c2287f4c73",
145+
"StepSucceededDetails": {
146146
"Result": {
147-
"Payload": "\"Item 1 processed\""
148-
}
147+
"Payload": "\"Item 2 processed\""
148+
},
149+
"RetryDetails": {}
149150
}
150151
},
151152
{
152153
"EventType": "StepSucceeded",
153154
"SubType": "Step",
154155
"EventId": 15,
155-
"Id": "6151f5ab282d90e4",
156-
"Name": "process-1",
157-
"EventTimestamp": "2025-12-10T00:12:32.106Z",
158-
"ParentId": "98c6f2c2287f4c73",
156+
"Id": "b425e0c75591aa8f",
157+
"Name": "process-2",
158+
"EventTimestamp": "2025-12-11T23:34:29.176Z",
159+
"ParentId": "13cee27a2bd93915",
159160
"StepSucceededDetails": {
160161
"Result": {
161-
"Payload": "\"Item 2 processed\""
162+
"Payload": "\"Item 3 processed\""
163+
},
164+
"RetryDetails": {}
165+
}
166+
},
167+
{
168+
"EventType": "StepSucceeded",
169+
"SubType": "Step",
170+
"EventId": 16,
171+
"Id": "a4e1cd317d54f087",
172+
"Name": "process-3",
173+
"EventTimestamp": "2025-12-11T23:34:29.176Z",
174+
"ParentId": "3a170a9fe4f47efa",
175+
"StepSucceededDetails": {
176+
"Result": {
177+
"Payload": "\"Item 4 processed\""
178+
},
179+
"RetryDetails": {}
180+
}
181+
},
182+
{
183+
"EventType": "StepSucceeded",
184+
"SubType": "Step",
185+
"EventId": 17,
186+
"Id": "0f42756e5788f9b0",
187+
"Name": "process-4",
188+
"EventTimestamp": "2025-12-11T23:34:29.176Z",
189+
"ParentId": "12426c956d1bc501",
190+
"StepSucceededDetails": {
191+
"Result": {
192+
"Payload": "\"Item 5 processed\""
162193
},
163194
"RetryDetails": {}
164195
}
165196
},
166197
{
167198
"EventType": "ContextSucceeded",
168199
"SubType": "MapIteration",
169-
"EventId": 16,
200+
"EventId": 18,
201+
"Id": "ea66c06c1e1c05fa",
202+
"Name": "map-item-0",
203+
"EventTimestamp": "2025-12-11T23:34:29.894Z",
204+
"ParentId": "c4ca4238a0b92382",
205+
"ContextSucceededDetails": {
206+
"Result": {
207+
"Payload": "\"Item 1 processed\""
208+
}
209+
}
210+
},
211+
{
212+
"EventType": "ContextSucceeded",
213+
"SubType": "MapIteration",
214+
"EventId": 19,
170215
"Id": "98c6f2c2287f4c73",
171216
"Name": "map-item-1",
172-
"EventTimestamp": "2025-12-10T00:12:32.108Z",
217+
"EventTimestamp": "2025-12-11T23:34:29.894Z",
173218
"ParentId": "c4ca4238a0b92382",
174219
"ContextSucceededDetails": {
175220
"Result": {
176221
"Payload": "\"Item 2 processed\""
177222
}
178223
}
179224
},
225+
{
226+
"EventType": "ContextSucceeded",
227+
"SubType": "MapIteration",
228+
"EventId": 20,
229+
"Id": "13cee27a2bd93915",
230+
"Name": "map-item-2",
231+
"EventTimestamp": "2025-12-11T23:34:29.894Z",
232+
"ParentId": "c4ca4238a0b92382",
233+
"ContextSucceededDetails": {
234+
"Result": {
235+
"Payload": "\"Item 3 processed\""
236+
}
237+
}
238+
},
239+
{
240+
"EventType": "ContextSucceeded",
241+
"SubType": "MapIteration",
242+
"EventId": 21,
243+
"Id": "3a170a9fe4f47efa",
244+
"Name": "map-item-3",
245+
"EventTimestamp": "2025-12-11T23:34:29.894Z",
246+
"ParentId": "c4ca4238a0b92382",
247+
"ContextSucceededDetails": {
248+
"Result": {
249+
"Payload": "\"Item 4 processed\""
250+
}
251+
}
252+
},
253+
{
254+
"EventType": "ContextSucceeded",
255+
"SubType": "MapIteration",
256+
"EventId": 22,
257+
"Id": "12426c956d1bc501",
258+
"Name": "map-item-4",
259+
"EventTimestamp": "2025-12-11T23:34:29.895Z",
260+
"ParentId": "c4ca4238a0b92382",
261+
"ContextSucceededDetails": {
262+
"Result": {
263+
"Payload": "\"Item 5 processed\""
264+
}
265+
}
266+
},
180267
{
181268
"EventType": "ContextSucceeded",
182269
"SubType": "Map",
183-
"EventId": 17,
270+
"EventId": 23,
184271
"Id": "c4ca4238a0b92382",
185272
"Name": "min-successful-items",
186-
"EventTimestamp": "2025-12-10T00:12:32.108Z",
273+
"EventTimestamp": "2025-12-11T23:34:29.895Z",
187274
"ContextSucceededDetails": {
188275
"Result": {
189276
"Payload": "{\"all\":[{\"result\":\"Item 1 processed\",\"index\":0,\"status\":\"SUCCEEDED\"},{\"result\":\"Item 2 processed\",\"index\":1,\"status\":\"SUCCEEDED\"},{\"index\":2,\"status\":\"STARTED\"},{\"index\":3,\"status\":\"STARTED\"},{\"index\":4,\"status\":\"STARTED\"}],\"completionReason\":\"MIN_SUCCESSFUL_REACHED\"}"
@@ -193,40 +280,51 @@
193280
{
194281
"EventType": "WaitStarted",
195282
"SubType": "Wait",
196-
"EventId": 18,
283+
"EventId": 24,
197284
"Id": "c81e728d9d4c2f63",
198-
"EventTimestamp": "2025-12-10T00:12:32.108Z",
285+
"EventTimestamp": "2025-12-11T23:34:29.899Z",
199286
"WaitStartedDetails": {
200287
"Duration": 1,
201-
"ScheduledEndTimestamp": "2025-12-10T00:12:33.108Z"
288+
"ScheduledEndTimestamp": "2025-12-11T23:34:30.899Z"
202289
}
203290
},
204291
{
205292
"EventType": "WaitSucceeded",
206293
"SubType": "Wait",
207-
"EventId": 19,
294+
"EventId": 25,
208295
"Id": "c81e728d9d4c2f63",
209-
"EventTimestamp": "2025-12-10T00:12:33.109Z",
296+
"EventTimestamp": "2025-12-11T23:34:29.902Z",
210297
"WaitSucceededDetails": {
211298
"Duration": 1
212299
}
213300
},
214301
{
215302
"EventType": "InvocationCompleted",
216-
"EventId": 20,
217-
"EventTimestamp": "2025-12-10T00:12:33.111Z",
303+
"EventId": 26,
304+
"EventTimestamp": "2025-12-11T23:34:29.902Z",
218305
"InvocationCompletedDetails": {
219-
"StartTimestamp": "2025-12-10T00:12:31.901Z",
220-
"EndTimestamp": "2025-12-10T00:12:33.111Z",
306+
"StartTimestamp": "2025-12-11T23:34:27.714Z",
307+
"EndTimestamp": "2025-12-11T23:34:29.902Z",
221308
"Error": {},
222-
"RequestId": "d45c051d-4981-4258-8008-22d1bac542de"
309+
"RequestId": "a81f172b-84ed-4cae-8a29-6d0fab025beb"
310+
}
311+
},
312+
{
313+
"EventType": "InvocationCompleted",
314+
"EventId": 27,
315+
"EventTimestamp": "2025-12-11T23:34:29.925Z",
316+
"InvocationCompletedDetails": {
317+
"StartTimestamp": "2025-12-11T23:34:29.921Z",
318+
"EndTimestamp": "2025-12-11T23:34:29.925Z",
319+
"Error": {},
320+
"RequestId": "14a648a0-a4d7-482d-aeec-52cca0c842f5"
223321
}
224322
},
225323
{
226324
"EventType": "ExecutionSucceeded",
227-
"EventId": 21,
228-
"Id": "9d245077-e425-42f8-a8b5-521cac34e9d2",
229-
"EventTimestamp": "2025-12-10T00:12:33.111Z",
325+
"EventId": 28,
326+
"Id": "023ef399-731b-47ff-88cb-046d628ad1a4",
327+
"EventTimestamp": "2025-12-11T23:34:29.925Z",
230328
"ExecutionSucceededDetails": {
231329
"Result": {
232330
"Payload": "{\"successCount\":2,\"totalCount\":5,\"completionReason\":\"MIN_SUCCESSFUL_REACHED\",\"results\":[\"Item 1 processed\",\"Item 2 processed\"]}"

packages/aws-durable-execution-sdk-js-examples/src/examples/map/min-successful/map-min-successful.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { OperationStatus } from "@aws/durable-execution-sdk-js-testing";
44

55
createTests({
66
handler,
7+
localRunnerConfig: {
8+
checkpointDelay: 700,
9+
},
710
tests: (runner, { assertEventSignatures }) => {
811
it("should complete early when minSuccessful is reached", async () => {
912
const execution = await runner.run();
@@ -31,7 +34,7 @@ createTests({
3134
expect(item1?.getStatus()).toBe(OperationStatus.SUCCEEDED);
3235

3336
// TODO: Re-enable these assertions when we find the root cause of the cloud timing issue
34-
// where remaining items show SUCCEEDED instead of STARTED
37+
// where remaining items show SUCCEEDED instead of STARTED https://github.com/aws/aws-durable-execution-sdk-js/issues/367
3538
// Remaining items should be in STARTED state (not completed)
3639
// expect(item2?.getStatus()).toBe(OperationStatus.STARTED);
3740
// expect(item3?.getStatus()).toBe(OperationStatus.STARTED);

0 commit comments

Comments
 (0)