Skip to content

test: add multi-server scenarios over a shared database - #1247

Open
mykytanetipa wants to merge 1 commit into
multiserver/handler-integrationfrom
multiserver/integration-tests
Open

mykytanetipa wants to merge 1 commit into
multiserver/handler-integrationfrom
multiserver/integration-tests

Conversation

@mykytanetipa

Copy link
Copy Markdown
Collaborator

Adds end-to-end coverage for the multi-replica path against a real database.

Key changes:

  • Two DefaultRequestHandlerV2 replicas share one database, each on its own engine, covering cross-replica send, resubscribe, cancel and multi-turn input_required.
  • Covers two replicas following up on the same task at once, asserting no update is lost.
  • Adds the database-backed cluster tests to scripts/run_db_tests.sh.

Design discussion: #1224

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

🧪 Code Coverage (vs multiserver/handler-integration)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/agent_execution/active_task.py 94.18% 94.63% 🟢 +0.45%
src/a2a/server/cluster/database_event_stream.py 90.82% 92.86% 🟢 +2.04%
Total 92.83% 92.87% 🟢 +0.04%

Generated by coverage-comment.yml

@mykytanetipa mykytanetipa changed the title tests: add multi-server scenarios over a shared database test: add multi-server scenarios over a shared database Sep 17, 2026
@mykytanetipa
mykytanetipa force-pushed the multiserver/integration-tests branch from 8f20966 to 66f6dec Compare September 17, 2026 10:22
@mykytanetipa
mykytanetipa force-pushed the multiserver/integration-tests branch from 66f6dec to eee85ac Compare September 17, 2026 10:36
@mykytanetipa
mykytanetipa marked this pull request as ready for review September 17, 2026 10:51
@mykytanetipa
mykytanetipa requested a review from a team as a code owner September 17, 2026 10:51
@mykytanetipa
mykytanetipa force-pushed the multiserver/integration-tests branch from eee85ac to 50f1154 Compare September 22, 2026 22:47
… test wiring

Adds tests/integration/test_multiserver.py: two DefaultRequestHandlerV2
replicas sharing one database (versioned store + DB event stream, each replica
on its own engine), exercising cross-replica send, resubscribe, and cancel end
to end. Runs only against a real Postgres or MySQL server -- parametrized on
POSTGRES_TEST_DSN / MYSQL_TEST_DSN and skipped entirely when neither is set.
SQLite is excluded on purpose: its whole-table locking cannot model two
simultaneous writers (the lost-update scenario), and the sequential
cross-replica behaviours are already covered without a database by
tests/server/cluster/test_*_multireplica.py.

Wires the DB-requiring cluster tests into scripts/run_db_tests.sh so the local
docker-compose helper runs them alongside the existing database tests. CI needs
no change: unit-tests.yml already runs the whole tests/ tree with the service-
container DSNs exported.
@mykytanetipa
mykytanetipa force-pushed the multiserver/integration-tests branch from 50f1154 to e3f6a13 Compare September 22, 2026 23:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant