From 4e65350eeee3c9fd075986464dffcffe68ea4dbd Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Thu, 6 Aug 2026 00:08:14 -0700 Subject: [PATCH] fix: resolve GitHub Actions CI collection and flakiness issues PiperOrigin-RevId: 960108371 --- .github/workflows/continuous-integration.yml | 13 +++++++++---- tests/unittests/test_samples.py | 6 +++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index c248a397..ec445f09 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -145,10 +145,12 @@ jobs: source .venv/bin/activate uv sync --extra test + - name: List installed packages + run: uv pip list + - name: Run unit tests with pytest run: | - source .venv/bin/activate - pytest tests/unittests \ + uv run pytest tests/unittests \ -n auto \ --ignore=tests/unittests/artifacts/test_artifact_service.py \ --ignore=tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py @@ -185,10 +187,13 @@ jobs: source .venv/bin/activate uv sync --extra test + - name: List installed packages (before reinstall) + run: uv pip list + - name: Run A2A tests against a2a-sdk v0.3 run: | - source .venv/bin/activate uv pip install --reinstall-package a2a-sdk 'a2a-sdk>=0.3.4,<0.4' - pytest tests/unittests/a2a \ + uv pip list + uv run pytest tests/unittests/a2a \ tests/unittests/agents/test_remote_a2a_agent.py \ tests/unittests/integrations/agent_registry/test_agent_registry.py diff --git a/tests/unittests/test_samples.py b/tests/unittests/test_samples.py index 3dde0567..0b46aa1d 100644 --- a/tests/unittests/test_samples.py +++ b/tests/unittests/test_samples.py @@ -50,7 +50,11 @@ def get_test_files(): """Yields (sample_dir, test_file_path).""" if not CONTRIBUTING_DIR.exists(): return - for test_file in CONTRIBUTING_DIR.rglob("tests/*.json"): + # Sort files to ensure deterministic order across pytest-xdist workers + test_files = sorted( + CONTRIBUTING_DIR.rglob("tests/*.json"), key=lambda p: p.as_posix() + ) + for test_file in test_files: sample_dir = test_file.parent.parent if ( (sample_dir / "agent.py").exists()