Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8afcbc7
Add failover config options
mdaigle Jun 12, 2025
0007a10
Test failovers
mdaigle Jun 16, 2025
03b8e49
Merge branch 'main' of github.com:dotnet/SqlClient into dev/mdaigle/f…
mdaigle Jul 16, 2025
2adf97c
Test routing through a transient error.
mdaigle Jul 16, 2025
5113fa7
Move startup to GenericTDSServer.
mdaigle Jul 16, 2025
522abba
Remove duplicate server start code from ManualTests
mdaigle Jul 17, 2025
c41d0dc
Refactor failover param ownership. Fix pool invalidation test.
mdaigle Jul 17, 2025
922b3ef
Cleanup. Rename GenericTDSServer to differentiate from the generic cl…
mdaigle Jul 17, 2025
6ef83d7
Rename classes to match style. Make GenericTdsServer<T> abstract.
mdaigle Jul 17, 2025
47cbb48
Fix connection string to use optional encryption.
mdaigle Jul 24, 2025
905bc5d
Fix connection string to use optional encryption.
mdaigle Jul 24, 2025
47aa3a3
Add transient timeout server. Add regression test for transient timeo…
mdaigle Jul 24, 2025
fe9e7e4
Clean up tests. Add new retry/failover tests.
mdaigle Jul 30, 2025
93ebf98
Add new retry/failover tests.
mdaigle Jul 30, 2025
04a4329
Added tests. Moved tests to UnitTests project. Removed failover repro.
mdaigle Jul 30, 2025
ee9d157
Restructure tests for readability.
mdaigle Jul 30, 2025
11d90db
Update tests to remove unneeded routing. Check that connections end u…
mdaigle Aug 1, 2025
846a493
Review changes
mdaigle Aug 1, 2025
f08447a
Add TDS projects to compile set for UnitTests.
mdaigle Aug 1, 2025
7780cdd
fix tds projects inclusion
mdaigle Aug 1, 2025
ed2285c
Fix test server disposal.
mdaigle Aug 4, 2025
47b7bc2
Remove tests for unsupported scenarios.
mdaigle Aug 4, 2025
7532181
Add comments for confusing behavior.
mdaigle Aug 4, 2025
57aeb4d
Rename files to match class names.
mdaigle Aug 4, 2025
12cbb82
Remove proj change.
mdaigle Aug 4, 2025
038a0cd
Skip failing unit tests.
mdaigle Aug 5, 2025
206216a
Rename test folder.
mdaigle Aug 14, 2025
487fc26
Review changes
mdaigle Aug 14, 2025
aeb0c29
Merge branch 'main' of github.com:dotnet/SqlClient into dev/mdaigle/f…
mdaigle Aug 14, 2025
767e99c
Adjust tests based on multisubnetfailover setting.
mdaigle Aug 15, 2025
4bda823
Improve test reliability.
mdaigle Aug 18, 2025
a92dc51
Make failover test more reliable.
mdaigle Aug 18, 2025
2638eca
Rename to fix missing file.
mdaigle Aug 18, 2025
1492ead
Update tests to work on linux/mac
mdaigle Aug 18, 2025
d237176
Add test for default TNIR setting in connection string.
mdaigle Aug 26, 2025
0c03ddc
Remove active issues and adapt tests to set multisubnetfailover and T…
mdaigle Aug 26, 2025
f379cba
Enable setting localhost as an azure endpoint.
mdaigle Aug 27, 2025
d1bb855
Rename files and test cases for clarity. Rework some failover connect…
mdaigle Aug 27, 2025
e515abe
Add azure routing tests.
mdaigle Aug 27, 2025
7d57e12
Serialize tests. Remove connection killing.
mdaigle Sep 3, 2025
2fe29ed
Add additional assertions.
mdaigle Sep 3, 2025
5eee939
Add common test project to unit test restore targets.
mdaigle Sep 3, 2025
c020ddf
Mark tests as flaky and skip in the pipeline for now.
mdaigle Sep 4, 2025
32b9a10
Merge branch 'main' of github.com:dotnet/SqlClient into dev/mdaigle/f…
mdaigle Sep 4, 2025
71a0228
Fix formatting.
mdaigle Sep 5, 2025
d8b1053
Merge main
mdaigle Sep 22, 2025
fe78207
Comply with new compiler error settings.
mdaigle Sep 23, 2025
c195cbf
Review changes.
mdaigle Sep 24, 2025
5415ea4
oops
mdaigle Sep 24, 2025
d218cde
Update namespace.
mdaigle Sep 24, 2025
9ef9949
Review changes.
mdaigle Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<NetStandardDriver Include="**/netcore/ref/Microsoft.Data.SqlClient*.csproj" />
<AKVProvider Include="**/add-ons/**/AzureKeyVaultProvider/*.csproj" />

<UnitTests Include="**/Common/Common.csproj" />
<UnitTests Include="**/tools/TDS/TDS/TDS.csproj" />
<UnitTests Include="**/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj" />
<UnitTests Include="**/tools/TDS/TDS.Servers/TDS.Servers.csproj" />
Expand Down Expand Up @@ -230,7 +231,7 @@
<TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
</PropertyGroup>
<Message Text=">>> Running unit tests for Windows via command: $(TestCommand)"/>
<Exec ConsoleToMsBuild="true" Command="$(TestCommand)"/>

Check failure on line 234 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (win11_Azure_Sql net462_AnyCPU_2)

build.proj#L234

build.proj(234,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\UnitTests\Microsoft.Data.SqlClient.UnitTests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetfxVersion=net462 -p:TestTargetOS=Windowsnetfx --collect "Code coverage" --results-directory TestResults --filter "category!=failing" --logger:"trx;LogFilePrefix=Unit-Windowsnetfx-1,2,3" " exited with code 1.

Check failure on line 234 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Sql19 net462_AnyCPU_2)

build.proj#L234

build.proj(234,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\UnitTests\Microsoft.Data.SqlClient.UnitTests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetfxVersion=net462 -p:TestTargetOS=Windowsnetfx --collect "Code coverage" --results-directory TestResults --filter "category!=failing" --logger:"trx;LogFilePrefix=Unit-Windowsnetfx-1,2,3" " exited with code 1.

Check failure on line 234 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (win11_Azure_Sql net8_0_AnyCPU_NativeSNI_2)

build.proj#L234

build.proj(234,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\UnitTests\Microsoft.Data.SqlClient.UnitTests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net8.0 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=failing" --logger:"trx;LogFilePrefix=Unit-Windowsnetcoreapp-1,2,3" " exited with code 1.
</Target>

<!-- Run all unit tests applicable to Unix. -->
Expand Down Expand Up @@ -326,7 +327,7 @@
<TestCommand>$(TestCommand.Replace($([System.Environment]::NewLine), " "))</TestCommand>
</PropertyGroup>
<Message Text=">>> Running Manual test for Windows via command: $(TestCommand)" />
<Exec ConsoleToMsBuild="true" Command="$(TestCommand)" />

Check failure on line 330 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package (Win22_Azure_ARM64_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L330

build.proj(330,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 330 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient (Win22_Azure_ARM64_Sql net9_0_AnyCPU_ManagedSNI_3)

build.proj#L330

build.proj(330,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Project -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.

Check failure on line 330 in build.proj

View check run for this annotation

Azure Pipelines / CI-SqlClient-Package

build.proj#L330

build.proj(330,5): Error MSB3073: The command " dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" --no-build -v n -p:Configuration=Release -p:TargetnetcoreVersion=net9.0 -p:ReferenceType=Package -p:TestSet=3 -p:TestTargetOS=Windowsnetcoreapp --collect "Code coverage" --results-directory TestResults --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" --logger:"trx;LogFilePrefix=Manual-Windowsnetcoreapp-3" " exited with code 1.
</Target>

<!-- Run all Manual tests applicable to Unix. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Microsoft.Identity.Client;
using Microsoft.SqlServer.Server;
using System.Security.Authentication;
using System.Collections.Generic;

#if NETFRAMEWORK
using System.Reflection;
Expand Down Expand Up @@ -780,7 +781,7 @@ internal static Version GetAssemblyVersion()
/// <remarks>This array includes endpoint URLs for Azure SQL in global, Germany, US Government,
/// China, and Fabric environments. These endpoints are used to identify and interact with Azure SQL services
/// in their respective regions or environments.</remarks>
internal static readonly string[] s_azureSqlServerEndpoints = { AZURE_SQL,
internal static readonly List<string> s_azureSqlServerEndpoints = new() { AZURE_SQL,
AZURE_SQL_GERMANY,
AZURE_SQL_USGOV,
AZURE_SQL_CHINA,
Expand Down Expand Up @@ -816,11 +817,11 @@ internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)

internal static bool IsAzureSqlServerEndpoint(string dataSource)
{
return IsEndpoint(dataSource, s_azureSqlServerEndpoints);
return IsEndpoint(dataSource, s_azureSqlServerEndpoints.AsReadOnly());
}

// This method assumes dataSource parameter is in TCP connection string format.
private static bool IsEndpoint(string dataSource, string[] endpoints)
private static bool IsEndpoint(string dataSource, IReadOnlyList<string> endpoints)
{
int length = dataSource.Length;
// remove server port
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ internal static class DbConnectionStringDefaults

#if NETFRAMEWORK
internal const bool ConnectionReset = true;
internal static readonly bool TransparentNetworkIpResolution = !LocalAppContextSwitches.DisableTnirByDefault;
internal static bool TransparentNetworkIpResolution => !LocalAppContextSwitches.DisableTnirByDefault;
internal const string NetworkLibrary = "";
#endif
}
Expand Down
29 changes: 29 additions & 0 deletions src/Microsoft.Data.SqlClient/tests/UnitTests/ADPHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Microsoft.Data.Common
{
internal class ADPHelper : IDisposable
{
List<string> _originalAzureSqlServerEndpoints;

internal ADPHelper()
{
_originalAzureSqlServerEndpoints = [.. ADP.s_azureSqlServerEndpoints];
}

internal void AddAzureSqlServerEndpoint(string endpoint)
{
ADP.s_azureSqlServerEndpoints.Add(endpoint);
}

public void Dispose()
{
ADP.s_azureSqlServerEndpoints.Clear();
ADP.s_azureSqlServerEndpoints.AddRange(_originalAzureSqlServerEndpoints);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<ProjectReference Include="$(TestsPath)tools\TDS\TDS.Servers\TDS.Servers.csproj" />
<ProjectReference Include="$(TestsPath)tools\TDS\TDS.EndPoint\TDS.EndPoint.csproj" />
<ProjectReference Include="$(TestsPath)tools\TDS\TDS\TDS.csproj" />
<ProjectReference Include="$(TestsPath)Common\Common.csproj" />
</ItemGroup>
<!-- .NET Framework references -->
<ItemGroup Condition="$(TargetGroup) == 'netfx'">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using System;
using Microsoft.Data.SqlClient.Tests.Common;
using Xunit;
using static Microsoft.Data.SqlClient.Tests.Common.LocalAppContextSwitchesHelper;

namespace Microsoft.Data.SqlClient.UnitTests.Microsoft.Data.SqlClient
{
public class SqlConnectionStringTest : IDisposable
{
private LocalAppContextSwitchesHelper _appContextSwitchHelper;
public SqlConnectionStringTest()
{
// Ensure that the app context switch is set to the default value
_appContextSwitchHelper = new LocalAppContextSwitchesHelper();
}

#if NETFRAMEWORK
[Theory]
[InlineData("test.database.windows.net", true, Tristate.True, true)]
[InlineData("test.database.windows.net", false, Tristate.True, false)]
[InlineData("test.database.windows.net", null, Tristate.True, false)]
[InlineData("test.database.windows.net", true, Tristate.False, true)]
[InlineData("test.database.windows.net", false, Tristate.False, false)]
[InlineData("test.database.windows.net", null, Tristate.False, true)]
[InlineData("test.database.windows.net", true, Tristate.NotInitialized, true)]
[InlineData("test.database.windows.net", false, Tristate.NotInitialized, false)]
[InlineData("test.database.windows.net", null, Tristate.NotInitialized, true)]
[InlineData("my.test.server", true, Tristate.True, true)]
[InlineData("my.test.server", false, Tristate.True, false)]
[InlineData("my.test.server", null, Tristate.True, false)]
[InlineData("my.test.server", true, Tristate.False, true)]
[InlineData("my.test.server", false, Tristate.False, false)]
[InlineData("my.test.server", null, Tristate.False, true)]
[InlineData("my.test.server", true, Tristate.NotInitialized, true)]
[InlineData("my.test.server", false, Tristate.NotInitialized, false)]
[InlineData("my.test.server", null, Tristate.NotInitialized, true)]
public void TestDefaultTNIR(string dataSource, bool? tnirEnabledInConnString, Tristate tnirDisabledAppContext, bool expectedValue)
{
// Note: TNIR is only supported on .NET Framework.
// Note: TNIR is disabled by default for Azure SQL Database servers (i.e. *.database.windows.net)
// and when using federated auth unless explicitly set in the connection string.
// However, this evaluation only happens at login time so TNIR behavior may not match
// the value of TransparentNetworkIPResolution property in SqlConnectionString.

// Arrange
_appContextSwitchHelper.DisableTnirByDefaultField = tnirDisabledAppContext;

// Act
SqlConnectionStringBuilder builder = new();
builder.DataSource = dataSource;
if (tnirEnabledInConnString.HasValue)
{
builder.TransparentNetworkIPResolution = tnirEnabledInConnString.Value;
}
SqlConnectionString connectionString = new(builder.ConnectionString);

// Assert
Assert.Equal(expectedValue, connectionString.TransparentNetworkIPResolution);
}
#endif

public void Dispose()
{
// Clean up any resources if necessary
_appContextSwitchHelper.Dispose();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Microsoft.Data.SqlClient.ScenarioTests
{
[Collection("SimulatedServerTests")]
public class ConnectionFailoverTests
{
//TODO parameterize for transient errors
Expand All @@ -31,7 +32,7 @@ public void TransientFault_NoFailover_DoesNotClearPool(uint errorCode)
var failoverDataSource = $"localhost,{failoverServer.EndPoint.Port}";

// Errors are off to start to allow the pool to warm up
using TransientFaultTdsServer initialServer = new TransientFaultTdsServer(new TransientFaultTdsServerArguments
using TransientTdsErrorTdsServer initialServer = new TransientTdsErrorTdsServer(new TransientTdsErrorTdsServerArguments
{
FailoverPartner = failoverDataSource
});
Expand Down Expand Up @@ -87,7 +88,7 @@ public void NetworkError_TriggersFailover_ClearsPool()
var failoverDataSource = $"localhost,{failoverServer.EndPoint.Port}";

// Errors are off to start to allow the pool to warm up
using TransientFaultTdsServer initialServer = new TransientFaultTdsServer(new TransientFaultTdsServerArguments
using TdsServer initialServer = new TdsServer(new TdsServerArguments
{
FailoverPartner = failoverDataSource
});
Expand All @@ -99,7 +100,11 @@ public void NetworkError_TriggersFailover_ClearsPool()
ConnectRetryInterval = 1,
ConnectTimeout = 30,
Encrypt = SqlConnectionEncryptOption.Optional,
InitialCatalog = "test"
InitialCatalog = "test",
MultiSubnetFailover = false,
#if NETFRAMEWORK
TransparentNetworkIPResolution = false,
#endif
};

// Open the initial connection to warm up the pool and populate failover partner information
Expand Down Expand Up @@ -136,9 +141,8 @@ public void NetworkError_TriggersFailover_ClearsPool()
Assert.Equal(2, failoverServer.PreLoginCount);
}

[ActiveIssue("https://github.com/dotnet/SqlClient/issues/3527")]
[Fact]
public void NetworkError_RetryDisabled_ShouldFail()
public void NetworkTimeout_ShouldFail()
{
using TdsServer failoverServer = new TdsServer(
new TdsServerArguments
Expand All @@ -152,8 +156,8 @@ public void NetworkError_RetryDisabled_ShouldFail()
using TransientDelayTdsServer server = new TransientDelayTdsServer(
new TransientDelayTdsServerArguments()
{
IsEnabledTransientTimeout = true,
SleepDuration = TimeSpan.FromMilliseconds(1000),
IsEnabledTransientDelay = true,
DelayDuration = TimeSpan.FromMilliseconds(2000),
FailoverPartner = $"localhost,{failoverServer.EndPoint.Port}",
});
server.Start();
Expand All @@ -162,27 +166,29 @@ public void NetworkError_RetryDisabled_ShouldFail()
{
DataSource = "localhost," + server.EndPoint.Port,
InitialCatalog = "master",// Required for failover partner to work
ConnectTimeout = 5,
ConnectTimeout = 1,
ConnectRetryInterval = 1,
ConnectRetryCount = 0, // Disable retry
Encrypt = false,
MultiSubnetFailover = false,
#if NETFRAMEWORK
TransparentNetworkIPResolution = false,
#endif
};
using SqlConnection connection = new(builder.ConnectionString);

// Act
Assert.Throws<SqlException>(() => connection.Open());
var e = Assert.Throws<SqlException>(() => connection.Open());

// Assert
// On the first connection attempt, no failover partner information is available,
// so the connection will retry on the same server.
Assert.Contains("Connection Timeout Expired", e.Message);
Assert.Equal(ConnectionState.Closed, connection.State);
Assert.Equal(1, server.PreLoginCount);
Assert.Equal(0, failoverServer.PreLoginCount);
}

[ActiveIssue("https://github.com/dotnet/SqlClient/issues/3528")]
[Fact]
public void NetworkError_RetryEnabled_ShouldConnectToPrimary()
public void NetworkDelay_ShouldConnectToPrimary()
{
using TdsServer failoverServer = new TdsServer(
new TdsServerArguments
Expand All @@ -196,8 +202,8 @@ public void NetworkError_RetryEnabled_ShouldConnectToPrimary()
using TransientDelayTdsServer server = new TransientDelayTdsServer(
new TransientDelayTdsServerArguments()
{
IsEnabledTransientTimeout = true,
SleepDuration = TimeSpan.FromMilliseconds(1000),
IsEnabledTransientDelay = true,
DelayDuration = TimeSpan.FromMilliseconds(1000),
FailoverPartner = $"localhost,{failoverServer.EndPoint.Port}",
});
server.Start();
Expand All @@ -207,8 +213,11 @@ public void NetworkError_RetryEnabled_ShouldConnectToPrimary()
DataSource = "localhost," + server.EndPoint.Port,
InitialCatalog = "master",// Required for failover partner to work
ConnectTimeout = 5,
ConnectRetryInterval = 1,
Encrypt = false,
MultiSubnetFailover = false,
#if NETFRAMEWORK
TransparentNetworkIPResolution = false,
#endif
};
using SqlConnection connection = new(builder.ConnectionString);
try
Expand All @@ -226,7 +235,7 @@ public void NetworkError_RetryEnabled_ShouldConnectToPrimary()
// so the connection will retry on the same server.
Assert.Equal(ConnectionState.Open, connection.State);
Assert.Equal($"localhost,{server.EndPoint.Port}", connection.DataSource);
Assert.Equal(2, server.PreLoginCount);
Assert.Equal(1, server.PreLoginCount);
Assert.Equal(0, failoverServer.PreLoginCount);
}

Expand All @@ -245,8 +254,8 @@ public void NetworkError_WithUserProvidedPartner_RetryDisabled_ShouldConnectToFa
using TransientDelayTdsServer server = new TransientDelayTdsServer(
new TransientDelayTdsServerArguments()
{
IsEnabledTransientTimeout = true,
SleepDuration = TimeSpan.FromMilliseconds(5000),
IsEnabledTransientDelay = true,
DelayDuration = TimeSpan.FromMilliseconds(10000),
FailoverPartner = $"localhost,{failoverServer.EndPoint.Port}",
});
server.Start();
Expand Down Expand Up @@ -277,8 +286,8 @@ public void NetworkError_WithUserProvidedPartner_RetryDisabled_ShouldConnectToFa
// so the connection will retry on the failover server.
Assert.Equal(ConnectionState.Open, connection.State);
Assert.Equal($"localhost,{failoverServer.EndPoint.Port}", connection.DataSource);
Assert.Equal(1, server.PreLoginCount);
Assert.Equal(1, failoverServer.PreLoginCount);
Assert.Equal(1, server.PreLoginCount);
}

[Fact]
Expand All @@ -296,8 +305,8 @@ public void NetworkError_WithUserProvidedPartner_RetryEnabled_ShouldConnectToFai
using TransientDelayTdsServer server = new TransientDelayTdsServer(
new TransientDelayTdsServerArguments()
{
IsEnabledTransientTimeout = true,
SleepDuration = TimeSpan.FromMilliseconds(1000),
IsEnabledTransientDelay = true,
DelayDuration = TimeSpan.FromMilliseconds(10000),
FailoverPartner = $"localhost,{failoverServer.EndPoint.Port}",
});
server.Start();
Expand Down Expand Up @@ -346,8 +355,8 @@ public void TransientFault_ShouldConnectToPrimary(uint errorCode)
});
failoverServer.Start();

using TransientFaultTdsServer server = new TransientFaultTdsServer(
new TransientFaultTdsServerArguments()
using TransientTdsErrorTdsServer server = new TransientTdsErrorTdsServer(
new TransientTdsErrorTdsServerArguments()
{
IsEnabledTransientError = true,
Number = errorCode,
Expand Down Expand Up @@ -397,8 +406,8 @@ public void TransientFault_RetryDisabled_ShouldFail(uint errorCode)
});
failoverServer.Start();

using TransientFaultTdsServer server = new TransientFaultTdsServer(
new TransientFaultTdsServerArguments()
using TransientTdsErrorTdsServer server = new TransientTdsErrorTdsServer(
new TransientTdsErrorTdsServerArguments()
{
IsEnabledTransientError = true,
Number = errorCode,
Expand Down Expand Up @@ -445,8 +454,8 @@ public void TransientFault_WithUserProvidedPartner_ShouldConnectToPrimary(uint e
});
failoverServer.Start();

using TransientFaultTdsServer server = new TransientFaultTdsServer(
new TransientFaultTdsServerArguments()
using TransientTdsErrorTdsServer server = new TransientTdsErrorTdsServer(
new TransientTdsErrorTdsServerArguments()
{
IsEnabledTransientError = true,
Number = errorCode,
Expand Down Expand Up @@ -497,8 +506,8 @@ public void TransientFault_WithUserProvidedPartner_RetryDisabled_ShouldFail(uint
});
failoverServer.Start();

using TransientFaultTdsServer server = new TransientFaultTdsServer(
new TransientFaultTdsServerArguments()
using TransientTdsErrorTdsServer server = new TransientTdsErrorTdsServer(
new TransientTdsErrorTdsServerArguments()
{
IsEnabledTransientError = true,
Number = errorCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Microsoft.Data.SqlClient.ScenarioTests
{
[Collection("SimulatedServerTests")]
public class ConnectionReadOnlyRoutingTests
{
[Fact]
Expand Down
Loading
Loading