Skip to content

Commit 09206c5

Browse files
committed
fix(aws-lambda): Increase shutdown timeout for lambda test infrastructure & added temporary workflow that runs aws_lambda tests in parallel
Refs: #6911
1 parent f31a990 commit 09206c5

2 files changed

Lines changed: 46 additions & 5 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: AWS Lambda Flake Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
aws-lambda-flake:
18+
name: aws_lambda py${{ matrix.python-version }} #${{ matrix.attempt }}
19+
timeout-minutes: 30
20+
runs-on: ubuntu-22.04
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.8", "3.9", "3.11", "3.13"]
25+
attempt: [1, 2, 3, 4, 5]
26+
services:
27+
docker:
28+
image: docker:dind
29+
options: --privileged
30+
steps:
31+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
34+
with:
35+
enable-cache: false
36+
- name: Setup Test Env
37+
run: uv sync
38+
- name: Test aws_lambda (attempt ${{ matrix.attempt }})
39+
run: |
40+
set -x
41+
./scripts/runtox.sh "py${{ matrix.python-version }}-aws_lambda"

tests/integrations/aws_lambda/test_aws_lambda.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
DOCKER_NETWORK_NAME = "lambda-test-network"
1616
SAM_TEMPLATE_FILE = "sam.template.yaml"
17+
SAM_SHUTDOWN_TIMEOUT = 60
1718

1819

1920
@pytest.fixture(scope="session", autouse=True)
@@ -78,13 +79,12 @@ def before_test():
7879

7980
finally:
8081
print("[test_environment fixture] Tearing down AWS Lambda test infrastructure")
81-
8282
process.terminate()
83-
process.wait(timeout=10) # Give it time to shut down gracefully
84-
85-
# Force kill if still running
86-
if process.poll() is None:
83+
try:
84+
process.wait(timeout=SAM_SHUTDOWN_TIMEOUT)
85+
except subprocess.TimeoutExpired:
8786
process.kill()
87+
process.wait()
8888

8989

9090
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)