Skip to content

Commit c69d777

Browse files
committed
update wait for condition test
1 parent 7d77eae commit c69d777

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/wait-for-condition/wait-for-condition.history.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{
33
"EventType": "ExecutionStarted",
44
"EventId": 1,
5-
"Id": "9bf8e8ae-4dce-4ea7-96b0-fb35ffdd90ed",
6-
"EventTimestamp": "2025-12-03T00:13:19.474Z",
5+
"Id": "f83f76e4-e540-47f0-93fa-a8eb2f206a01",
6+
"EventTimestamp": "2025-12-03T00:17:10.251Z",
77
"ExecutionStartedDetails": {
88
"Input": {
99
"Payload": "{}"
@@ -15,15 +15,15 @@
1515
"SubType": "WaitForCondition",
1616
"EventId": 2,
1717
"Id": "c4ca4238a0b92382",
18-
"EventTimestamp": "2025-12-03T00:13:19.479Z",
18+
"EventTimestamp": "2025-12-03T00:17:10.279Z",
1919
"StepStartedDetails": {}
2020
},
2121
{
2222
"EventType": "StepSucceeded",
2323
"SubType": "WaitForCondition",
2424
"EventId": 3,
2525
"Id": "c4ca4238a0b92382",
26-
"EventTimestamp": "2025-12-03T00:13:19.480Z",
26+
"EventTimestamp": "2025-12-03T00:17:10.279Z",
2727
"StepSucceededDetails": {
2828
"Result": {
2929
"Payload": "1"
@@ -36,28 +36,28 @@
3636
{
3737
"EventType": "InvocationCompleted",
3838
"EventId": 4,
39-
"EventTimestamp": "2025-12-03T00:13:19.534Z",
39+
"EventTimestamp": "2025-12-03T00:17:10.282Z",
4040
"InvocationCompletedDetails": {
41-
"StartTimestamp": "2025-12-03T00:13:19.474Z",
42-
"EndTimestamp": "2025-12-03T00:13:19.534Z",
41+
"StartTimestamp": "2025-12-03T00:17:10.251Z",
42+
"EndTimestamp": "2025-12-03T00:17:10.282Z",
4343
"Error": {},
44-
"RequestId": "73cac836-1047-40e7-9600-4bb37ec3253d"
44+
"RequestId": "b649c4fe-6709-441c-9918-965754668b72"
4545
}
4646
},
4747
{
4848
"EventType": "StepStarted",
4949
"SubType": "WaitForCondition",
5050
"EventId": 5,
5151
"Id": "c4ca4238a0b92382",
52-
"EventTimestamp": "2025-12-03T00:13:20.492Z",
52+
"EventTimestamp": "2025-12-03T00:17:10.298Z",
5353
"StepStartedDetails": {}
5454
},
5555
{
5656
"EventType": "StepSucceeded",
5757
"SubType": "WaitForCondition",
5858
"EventId": 6,
5959
"Id": "c4ca4238a0b92382",
60-
"EventTimestamp": "2025-12-03T00:13:20.492Z",
60+
"EventTimestamp": "2025-12-03T00:17:10.298Z",
6161
"StepSucceededDetails": {
6262
"Result": {
6363
"Payload": "2"
@@ -71,28 +71,28 @@
7171
{
7272
"EventType": "InvocationCompleted",
7373
"EventId": 7,
74-
"EventTimestamp": "2025-12-03T00:13:20.543Z",
74+
"EventTimestamp": "2025-12-03T00:17:10.298Z",
7575
"InvocationCompletedDetails": {
76-
"StartTimestamp": "2025-12-03T00:13:20.491Z",
77-
"EndTimestamp": "2025-12-03T00:13:20.543Z",
76+
"StartTimestamp": "2025-12-03T00:17:10.283Z",
77+
"EndTimestamp": "2025-12-03T00:17:10.298Z",
7878
"Error": {},
79-
"RequestId": "d5262c34-db8f-4d73-8b8d-1326c8d570ab"
79+
"RequestId": "c6671565-a41f-4d8f-a2a9-6fe5f0107547"
8080
}
8181
},
8282
{
8383
"EventType": "StepStarted",
8484
"SubType": "WaitForCondition",
8585
"EventId": 8,
8686
"Id": "c4ca4238a0b92382",
87-
"EventTimestamp": "2025-12-03T00:13:21.501Z",
87+
"EventTimestamp": "2025-12-03T00:17:10.339Z",
8888
"StepStartedDetails": {}
8989
},
9090
{
9191
"EventType": "StepSucceeded",
9292
"SubType": "WaitForCondition",
9393
"EventId": 9,
9494
"Id": "c4ca4238a0b92382",
95-
"EventTimestamp": "2025-12-03T00:13:21.501Z",
95+
"EventTimestamp": "2025-12-03T00:17:10.339Z",
9696
"StepSucceededDetails": {
9797
"Result": {
9898
"Payload": "3"
@@ -105,19 +105,19 @@
105105
{
106106
"EventType": "InvocationCompleted",
107107
"EventId": 10,
108-
"EventTimestamp": "2025-12-03T00:13:21.501Z",
108+
"EventTimestamp": "2025-12-03T00:17:10.339Z",
109109
"InvocationCompletedDetails": {
110-
"StartTimestamp": "2025-12-03T00:13:21.499Z",
111-
"EndTimestamp": "2025-12-03T00:13:21.501Z",
110+
"StartTimestamp": "2025-12-03T00:17:10.319Z",
111+
"EndTimestamp": "2025-12-03T00:17:10.339Z",
112112
"Error": {},
113-
"RequestId": "ad8bac76-c55e-4b60-abcc-76d18e1883d0"
113+
"RequestId": "3a060841-db81-4dbb-a569-8454283f415e"
114114
}
115115
},
116116
{
117117
"EventType": "ExecutionSucceeded",
118118
"EventId": 11,
119-
"Id": "9bf8e8ae-4dce-4ea7-96b0-fb35ffdd90ed",
120-
"EventTimestamp": "2025-12-03T00:13:21.501Z",
119+
"Id": "f83f76e4-e540-47f0-93fa-a8eb2f206a01",
120+
"EventTimestamp": "2025-12-03T00:17:10.340Z",
121121
"ExecutionSucceededDetails": {
122122
"Result": {
123123
"Payload": "3"

packages/aws-durable-execution-sdk-js-examples/src/examples/wait-for-condition/wait-for-condition.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { handler } from "./wait-for-condition";
22
import historyEvents from "./wait-for-condition.history.json";
33
import { assertEventSignatures, createTests } from "../../utils/test-helper";
44

5-
// TODO: enable test when waitForCondition SDK implementation is fixed
6-
75
createTests({
86
name: "wait-for-condition test",
97
functionName: "wait-for-condition",
@@ -12,7 +10,7 @@ createTests({
1210
it("should invoke step three times before succeeding", async () => {
1311
const execution = await runner.run();
1412
expect(execution.getResult()).toStrictEqual(3);
15-
// expect(execution.getInvocations()).toHaveLength(3);
13+
expect(execution.getInvocations()).toHaveLength(3);
1614

1715
assertEventSignatures(execution.getHistoryEvents(), historyEvents);
1816
});

0 commit comments

Comments
 (0)