Add retrying execution strategy in tests#3799
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the EFCore.PG functional test configuration to run under a retrying execution strategy, aligning test runs with connection resiliency behavior and reducing flakiness from transient PostgreSQL/transport errors.
Changes:
- Configure all functional tests using
ApplyConfiguration()to useTestNpgsqlRetryingExecutionStrategy. - Keep existing shared test options (single-query splitting behavior and command timeout) unchanged.
| { | ||
| optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery); | ||
|
|
||
| optionsBuilder.ExecutionStrategy(d => new TestNpgsqlRetryingExecutionStrategy(d)); |
There was a problem hiding this comment.
TestNpgsqlRetryingExecutionStrategy uses NpgsqlRetryingExecutionStrategy defaults (6 retries with exponential backoff; the base class remarks indicate ~1 minute worst-case before failing). Enabling this globally for all functional tests can significantly lengthen feedback loops on deterministic failures that are classified transient (notably the added XX000 SQLSTATE). Consider configuring a smaller retry count / max delay for the test-wide strategy, or only enabling the retrying strategy in the specific tests/fixtures that need it to avoid long hangs on genuine failures.
No description provided.