Skip to content

Commit cf773e1

Browse files
authored
fix(aws-python-scheduled-cron): resume the live test now that Python logs show in output (#836)
1 parent 8d3b8d2 commit cf773e1

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

‎aws-python-scheduled-cron/README.md‎

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ You should see output like this:
4444

4545
```text
4646
Deploying "aws-python-scheduled-cron" to stage "dev" (us-east-1)
47-
✔ Service deployed to stack aws-python-scheduled-cron-dev (102s)
47+
✔ Service deployed to stack aws-python-scheduled-cron-dev (103s)
4848
functions:
49-
rateHandler: aws-python-scheduled-cron-dev-rateHandler (2.9 kB)
49+
rateHandler: aws-python-scheduled-cron-dev-rateHandler (3.6 kB)
5050
```
5151

5252
The schedule is active as soon as the deploy finishes; there is no further step.
@@ -59,14 +59,36 @@ Invoke the function now instead of waiting for the next run, and print its log:
5959
serverless invoke --function rateHandler --log
6060
```
6161

62-
The log printed after the response contains the line the handler writes, `Your cron function ran at`, followed by the current time.
62+
The function returns nothing, so the response is `null`. The log printed after it contains the line the handler writes, `Your cron function ran at`, followed by the current time in UTC:
6363

64-
To see the scheduled runs, read the function's logs. Each minute adds one line:
64+
```text
65+
null
66+
67+
----------------------
68+
69+
START - 85562358-d2ef-43af-9ee5-43cc94ef2aed - Version: $LATEST
70+
2026-11-25 20:43:43.932 - 85562358-d2ef-43af-9ee5-43cc94ef2aed - [INFO]
71+
Your cron function ran at 20:43:43.932250
72+
73+
REPORT - 85562358-d2ef-43af-9ee5-43cc94ef2aed
74+
Duration: 2.12 ms Billed Duration: 3 ms Memory Size: 1024 MB Max Memory Used: 33 MB
75+
```
76+
77+
To see the scheduled runs, read the function's logs. Each minute adds one run:
6578

6679
```bash
6780
serverless logs --function rateHandler
6881
```
6982

83+
```text
84+
START - 8d3a87fb-dbd1-47ac-b578-baa6676a9e11 - Version: $LATEST
85+
2026-11-25 20:44:33.725 - 8d3a87fb-dbd1-47ac-b578-baa6676a9e11 - [INFO]
86+
Your cron function ran at 20:44:33.725330
87+
END - 8d3a87fb-dbd1-47ac-b578-baa6676a9e11
88+
REPORT - 8d3a87fb-dbd1-47ac-b578-baa6676a9e11
89+
Duration: 1.74 ms Billed Duration: 2 ms Memory Size: 1024 MB Max Memory Used: 33 MB
90+
```
91+
7092
## How it works
7193

7294
`serverless.yml` attaches a `schedule` event to the function. The Framework turns it into an EventBridge rule:

‎aws-python-scheduled-cron/example.json‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
"contains": "Your cron function ran at"
3030
}
3131
}
32-
],
33-
"quarantine": {
34-
"reason": "Waits for the Serverless Framework release in which serverless invoke --log shows messages logged with Python's logging module",
35-
"since": "2026-11-19"
36-
}
32+
]
3733
}
3834
}

0 commit comments

Comments
 (0)