Skip to content

Add retrying execution strategy in tests#3799

Merged
roji merged 1 commit intonpgsql:mainfrom
roji:Retry
Mar 31, 2026
Merged

Add retrying execution strategy in tests#3799
roji merged 1 commit intonpgsql:mainfrom
roji:Retry

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Mar 31, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 31, 2026 07:19
@roji roji enabled auto-merge (squash) March 31, 2026 07:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 use TestNpgsqlRetryingExecutionStrategy.
  • Keep existing shared test options (single-query splitting behavior and command timeout) unchanged.

{
optionsBuilder.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery);

optionsBuilder.ExecutionStrategy(d => new TestNpgsqlRetryingExecutionStrategy(d));
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@roji roji merged commit 865e108 into npgsql:main Mar 31, 2026
14 checks passed
@roji roji deleted the Retry branch March 31, 2026 07:33
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.

2 participants