Skip to content

Commit 5b7f5f9

Browse files
TexasCodingclaude
andcommitted
Configure CI to run tests sequentially to avoid rate limiting
- Set max-parallel: 1 for test matrix to run tests one at a time - Add 30-second delay before tests to space out API calls - Update pytest config for shorter traceback output - This should prevent the 429 rate limit errors from Alpaca API The Alpaca API has rate limits that get exceeded when running 100+ tests in parallel across multiple Python versions. Running sequentially will take longer but should be more reliable. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ec9bfa8 commit 5b7f5f9

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
test:
3434
runs-on: ubuntu-latest
3535
strategy:
36+
max-parallel: 1 # Run tests sequentially to avoid rate limiting
3637
matrix:
3738
python-version: ['3.10', '3.11', '3.12']
3839

@@ -48,6 +49,11 @@ jobs:
4849
- name: Install dependencies
4950
run: uv sync --all-extras --dev
5051

52+
- name: Add delay to avoid rate limiting
53+
run: |
54+
echo "Waiting 30 seconds to avoid API rate limiting..."
55+
sleep 30
56+
5157
- name: Run tests with coverage
5258
env:
5359
ALPACA_API_KEY: ${{ secrets.ALPACA_API_KEY }}

.github/workflows/test-package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
build:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
16-
max-parallel: 1
16+
max-parallel: 1 # Run sequentially to avoid rate limiting
1717
fail-fast: false
1818
matrix:
1919
python-version: ["3.12"]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ addopts = [
152152
"--cov-report=term-missing",
153153
"--cov-report=html",
154154
"--cov-report=xml",
155+
"--tb=short", # Shorter traceback format
155156
]
156157
markers = [
157158
"slow: marks tests as slow (deselect with '-m \"not slow\"')",

0 commit comments

Comments
 (0)