Commit cbfb30e
authored
fix(aws-lambda): fix flake in aws lambda tests
### Description
- Catch `subprocess.TimeoutExpired` during SAM teardown and force-kill,
so slow shutdown cannot fail the entire test suite.
- Added temporary flake-check workflow that runs each test aws-lambda
test 5 times to verify this removes the flake (workflow is removed in
the last commit; was just to verify that it works).
[https://github.com/getsentry/sentry-python/actions/runs/30539137588/job/90862136512?pr=6937](last
successful run)
- Switched SAM `--warm-containers` startup from `EAGER` to `LAZY` so
Docker containers start on first invocation instead of all 21 at SAM
startup. Verified locally by running
`TESTPATH=tests/integrations/aws_lambda/test_aws_lambda.py uv run tox -e
py3.8-aws_lambda ` both for `EAGER` & `LAZY` 10x independently:
```
EAGER:
=================================================
Metric | Mean (s) | Std Dev (s)
=================================================
Setup time | 43.69 | 3.99
First call time | 1.92 | 0.22
Max Teardown time | 7.49 | 0.27
Total run time | 108.53 | 4.56
=================================================
LAZY:
=================================================
Metric | Mean (s) | Std Dev (s)
=================================================
Setup time | 33.32 | 1.82
First call time | 6.32 | 0.63
Max Teardown time | 6.90 | 0.18
Total run time | 102.06 | 3.60
=================================================
```
Resolves: #6911 & PY-26321 parent 4e9e97c commit cbfb30e
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | | - | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
0 commit comments