-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Akka.Persistence.Sql.Tests.SqlServer.SqlServerDataOptionsEndToEndSpec.Should_Start_ActorSystem_wth_Sql_Persistence fails intermittently in CI with a timeout waiting for message acknowledgment.
Failure Mode
Failed: Timeout 00:00:03 while waiting for a message of type System.String
The test times out at line 122 waiting for the first "ACK" message from the persistence actor:
_persistenceActor.Tell(1);
ExpectMsg<string>(Ack); // <-- Times out hereEvidence of Flakiness
- ✅ Passes when run in isolation
- ❌ Fails intermittently when run as part of full test suite in CI
- 🔍 Not a code regression - failure occurs in code paths unrelated to recent changes
Reproduction
# Passes in isolation
dotnet test src/Akka.Persistence.Sql.Tests/Akka.Persistence.Sql.Tests.csproj \
--filter "FullyQualifiedName~SqlServerDataOptionsEndToEndSpec"
# May fail when run with full suite (resource contention)
dotnet test src/Akka.Persistence.Sql.Tests/Akka.Persistence.Sql.Tests.csprojRoot Cause Analysis
The test is located in SqlDataOptionsEndToEndSpecBase.cs and uses:
- SQL Server test container (
SqlServerContainer) - Manual
ActorSystemSetupconfiguration (lines 75-82) - Does NOT use Akka.Hosting extensions
Likely causes:
- SQL Server container timing - Container may not be fully ready when test starts
- Resource contention - Multiple tests competing for SQL Server connections in parallel
- Network delays - Docker container networking issues in CI environment
Test Location
- File:
src/Akka.Persistence.Sql.Tests/SqlServer/SqlServerDataOptionsEndToEndSpec.cs - Base class:
src/Akka.Persistence.Sql.Tests/SqlDataOptionsEndToEndSpecBase.cs - Test method:
Should_Start_ActorSystem_wth_Sql_Persistence(line 116)
Suggested Fixes
- Increase timeout - Change from 3 seconds to 10+ seconds for CI environments
- Add container readiness check - Ensure SQL Server is fully initialized before running test
- Retry logic - Mark test with
[Retry]attribute if available - Sequential execution - Consider running SQL Server tests sequentially rather than in parallel
- Better container cleanup - Ensure proper cleanup between tests to avoid port/resource conflicts
Environment
- Occurs in CI builds (Azure DevOps)
- May be specific to Linux or Windows runners
- Related to SQL Server container initialization timing
Impact
- Low impact on development (passes in isolation)
- Medium impact on CI reliability (causes occasional build failures)
- Not a functional bug - test infrastructure issue
Related Files
src/Akka.Persistence.Sql.Tests/SqlServer/SqlServerDataOptionsEndToEndSpec.cssrc/Akka.Persistence.Sql.Tests/SqlDataOptionsEndToEndSpecBase.cssrc/Akka.Persistence.Sql.Tests.Common/Containers/SqlServerContainer.cs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working