The a2a.client module exposes Client, not A2AClient. The PR incorrectly changed the TDD scenario to check for A2AClient which does not exist in the installed a2a SDK, causing the unit_tests CI gate to fail.
Merge the two separate database transactions in ensure_default_mock_actor()
into a single atomic transaction to prevent Time-of-Check-Time-of-Use (TOCTOU)
race conditions in concurrent environments (e.g., parallel test workers).
The original implementation had a gap between checking for an existing default
actor and creating a new mock actor. In concurrent scenarios, multiple threads
could both observe no default and attempt to create one, leading to potential
constraint violations or inconsistent state.
The fix consolidates both operations into a single transaction, ensuring that
the check and creation are atomic and safe for concurrent callers.
Added BDD test scenarios to verify idempotency and concurrent safety:
- Idempotency: calling ensure_default_mock_actor multiple times produces same result
- Existing default safety: respects existing default actors
- Single actor creation: ensures only one mock actor is created
Closes#8448