Skip to content

Commit fd1688f

Browse files
cheenamalhotramdaigle
authored andcommitted
Tests | Address transient errors in CI pipelines (#4314)
* Retry installing dotnet in CI + address flaky tests * One more flaky test
1 parent 628d234 commit fd1688f

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

eng/pipelines/steps/install-dotnet.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ steps:
5757
- ${{ if ne(parameters.architecture, 'arm64') }}:
5858

5959
# Install the SDK listed in the global.json file.
60+
#
61+
# retryCountOnTaskFailure is set because UseDotNet@2 fails intermittently
62+
# in CI due to transient network/CDN issues when downloading the SDK.
6063
- task: UseDotNet@2
6164
displayName: Install .NET SDK (global.json)
65+
retryCountOnTaskFailure: 3
6266
inputs:
6367
installationPath: ${{ parameters.installDir }}
6468
packageType: sdk
@@ -71,6 +75,7 @@ steps:
7175
- ${{ each version in parameters.runtimes }}:
7276
- task: UseDotNet@2
7377
displayName: Install .NET ${{ version }} Runtime
78+
retryCountOnTaskFailure: 3
7479
inputs:
7580
installationPath: ${{ parameters.installDir }}
7681
packageType: runtime
@@ -83,8 +88,13 @@ steps:
8388
- ${{ else }}:
8489

8590
# Use the install script for ARM64.
91+
#
92+
# retryCountOnTaskFailure provides an outer retry around the script's
93+
# internal retry loop, in case the script download itself or the entire
94+
# step fails due to transient issues.
8695
- task: PowerShell@2
8796
displayName: Install .NET SDK and Runtimes for ARM64
97+
retryCountOnTaskFailure: 3
8898
inputs:
8999
targetType: filePath
90100
pwsh: true

src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionFailoverTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ public void TransientFault_ShouldConnectToPrimary(uint errorCode)
389389
[InlineData(40613)]
390390
[InlineData(42108)]
391391
[InlineData(42109)]
392+
[Trait("Category", "flaky")]
392393
public void TransientFault_RetryDisabled_ShouldFail(uint errorCode)
393394
{
394395
// Arrange
@@ -484,6 +485,7 @@ public void TransientFault_WithUserProvidedPartner_ShouldConnectToPrimary(uint e
484485
[InlineData(40613)]
485486
[InlineData(42108)]
486487
[InlineData(42109)]
488+
[Trait("Category", "flaky")]
487489
public void TransientFault_WithUserProvidedPartner_RetryDisabled_ShouldFail(uint errorCode)
488490
{
489491
// Arrange

src/Microsoft.Data.SqlClient/tests/UnitTests/SimulatedServerTests/ConnectionRoutingTestsAzure.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public void NetworkDelayAtRoutedLocation_RetryDisabled_ShouldSucceed()
159159
}
160160

161161
[Fact]
162+
[Trait("Category", "flaky")]
162163
public void NetworkTimeoutAtRoutedLocation_RetryDisabled_ShouldFail()
163164
{
164165
// Arrange

0 commit comments

Comments
 (0)