Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/integration-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
ignore: ""
# TODO: expand to full tests_integ/memory once test stability is addressed
- group: memory
path: tests_integ/memory/test_memory_client.py
path: tests_integ/memory/test_controlplane.py tests_integ/memory/test_memory_client.py
timeout: 10
extra-deps: ""
ignore: ""
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Install dependencies
run: |
pip install -e .
pip install --no-cache-dir pytest requests strands-agents uvicorn httpx starlette websockets ${{ matrix.extra-deps }}
pip install --no-cache-dir pytest pytest-xdist pytest-order requests strands-agents uvicorn httpx starlette websockets ${{ matrix.extra-deps }}

- name: Run integration tests
env:
Expand All @@ -162,7 +162,7 @@ jobs:
id: tests
timeout-minutes: ${{ matrix.timeout }}
run: |
pytest ${{ matrix.path }} ${{ matrix.ignore }} -s --log-cli-level=INFO
pytest ${{ matrix.path }} ${{ matrix.ignore }} -n auto --dist=loadscope -s --log-cli-level=INFO

safety-gate:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ dev = [
"pytest>=8.4.1",
"pytest-asyncio>=0.24.0",
"pytest-cov>=6.0.0",
"pytest-order>=1.3.0",
"ruff>=0.12.0",
"websockets>=14.1",
"wheel>=0.45.1",
Expand Down
16 changes: 16 additions & 0 deletions tests_integ/memory/helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import time

import pytest


def poll_until(fn, predicate, max_wait=180, poll_interval=10, fail_if=None):
"""Poll fn() until predicate(result) is True or max_wait exceeded."""
deadline = time.time() + max_wait
while time.time() < deadline:
result = fn()
if fail_if and fail_if(result):
pytest.fail(f"poll_until hit terminal state: {result}")
if predicate(result):
return result
time.sleep(poll_interval)
pytest.fail(f"poll_until timed out after {max_wait}s")
Loading
Loading