Skip to content

Commit a213d8e

Browse files
committed
User Story 38467: Backport mac server name fix
- Backported part of #3494 and all of #3591: - Added configurable test jobs timeout, defaulting to 90 minutes. - Reduced generated database names to 96 chars to try to fix macOS test failures.Increase test jobs timeout (#3591) - Fixed the unique name generators to: - Keep max lengths to 30 and 96 characters respectively. - Ensure uniqueness at the start of the names. - Added link to database identifier syntax.
1 parent c12134a commit a213d8e

37 files changed

+388
-187
lines changed

eng/pipelines/common/templates/jobs/ci-run-tests-job.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,18 @@ parameters:
7373
- Project
7474
- Package
7575

76+
# The timeout, in minutes, for this job.
77+
- name: timeout
78+
type: string
79+
default: 90
80+
7681
jobs:
7782
- job: ${{ format('{0}', coalesce(parameters.jobDisplayName, parameters.image, 'unknown_image')) }}
7883

84+
# Some of our tests take longer than the default 60 minutes to run on some
85+
# OSes and configurations.
86+
timeoutInMinutes: ${{ parameters.timeout }}
87+
7988
pool:
8089
name: '${{ parameters.poolName }}'
8190
${{ if eq(parameters.hostedPool, true) }}:

eng/pipelines/common/templates/jobs/run-tests-package-reference-job.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ parameters:
2020
- name: isPreview
2121
type: boolean
2222

23+
# The timeout, in minutes, for this job.
24+
- name: timeout
25+
type: string
26+
default: 90
27+
2328
jobs:
2429
- job: run_tests_package_reference
2530
displayName: 'Run tests with package reference'
2631
${{ if ne(parameters.dependsOn, 'empty')}}:
2732
dependsOn: '${{parameters.dependsOn }}'
33+
34+
# Some of our tests take longer than the default 60 minutes to run on some
35+
# OSes and configurations.
36+
timeoutInMinutes: ${{ parameters.timeout }}
37+
2838
pool:
2939
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
3040
isCustom: true

eng/pipelines/common/templates/stages/ci-run-tests-stage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ parameters:
3030
type: jobList
3131
default: []
3232

33+
# The timeout, in minutes, for each test job.
34+
- name: testsTimeout
35+
type: string
36+
default: 90
37+
3338
stages:
3439
- ${{ each config in parameters.testConfigurations }}:
3540
- ${{ each image in config.value.images }}:
@@ -47,6 +52,7 @@ stages:
4752
parameters:
4853
debug: ${{ parameters.debug }}
4954
buildType: ${{ parameters.buildType }}
55+
timeout: ${{ parameters.testsTimeout }}
5056
poolName: ${{ config.value.pool }}
5157
hostedPool: ${{ eq(config.value.hostedPool, true) }}
5258
image: ${{ image.value }}
@@ -72,6 +78,7 @@ stages:
7278
parameters:
7379
debug: ${{ parameters.debug }}
7480
buildType: ${{ parameters.buildType }}
81+
timeout: ${{ parameters.testsTimeout }}
7582
poolName: ${{ config.value.pool }}
7683
hostedPool: ${{ eq(config.value.hostedPool, true) }}
7784
image: ${{ image.value }}

eng/pipelines/dotnet-sqlclient-ci-core.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ parameters:
5757
type: string
5858
default: $(ci_var_defaultPoolName)
5959

60+
# The timeout, in minutes, for each test job.
61+
- name: testsTimeout
62+
type: string
63+
default: 90
64+
6065
variables:
6166
- template: libraries/ci-build-variables.yml@self
6267

@@ -78,6 +83,7 @@ stages:
7883
parameters:
7984
debug: ${{ parameters.debug }}
8085
buildType: ${{ parameters.buildType }}
86+
testsTimeout: ${{ parameters.testsTimeout }}
8187
${{ if eq(parameters.buildType, 'Package') }}:
8288
dependsOn: build_nugets
8389

eng/pipelines/dotnet-sqlclient-ci-package-reference-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
8181
- Project
8282
- Package
8383

84+
# The timeout, in minutes, for each test job.
85+
- name: testsTimeout
86+
displayName: 'Tests timeout (in minutes)'
87+
type: string
88+
default: 90
89+
8490
extends:
8591
template: dotnet-sqlclient-ci-core.yml@self
8692
parameters:
@@ -92,3 +98,4 @@ extends:
9298
useManagedSNI: ${{ parameters.useManagedSNI }}
9399
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
94100
buildType: ${{ parameters.buildType }}
101+
testsTimeout: ${{ parameters.testsTimeout }}

eng/pipelines/dotnet-sqlclient-ci-project-reference-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
7373
- Project
7474
- Package
7575

76+
# The timeout, in minutes, for each test job.
77+
- name: testsTimeout
78+
displayName: 'Tests timeout (in minutes)'
79+
type: string
80+
default: 90
81+
7682
extends:
7783
template: dotnet-sqlclient-ci-core.yml@self
7884
parameters:
@@ -84,3 +90,4 @@ extends:
8490
useManagedSNI: ${{ parameters.useManagedSNI }}
8591
codeCovTargetFrameworks: ${{ parameters.codeCovTargetFrameworks }}
8692
buildType: ${{ parameters.buildType }}
93+
testsTimeout: ${{ parameters.testsTimeout }}

eng/pipelines/dotnet-sqlclient-signing-pipeline.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
6767
type: boolean
6868
default: false
6969

70+
# The timeout, in minutes, for each test job.
71+
- name: testsTimeout
72+
displayName: 'Tests timeout (in minutes)'
73+
type: string
74+
default: 90
75+
7076
variables:
7177
- template: /eng/pipelines/libraries/variables.yml@self
7278
- name: packageFolderName
@@ -175,6 +181,7 @@ extends:
175181
parameters:
176182
packageFolderName: $(packageFolderName)
177183
isPreview: ${{ parameters['isPreview'] }}
184+
timeout: ${{ parameters.testsTimeout }}
178185
downloadPackageStep:
179186
download: current
180187
artifact: $(packageFolderName)

src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ApiShould.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public void SqlParameterProperties(string connection)
148148
const string firstColumnName = @"firstColumn";
149149
const string secondColumnName = @"secondColumn";
150150
const string thirdColumnName = @"thirdColumn";
151-
string inputProcedureName = DataTestUtility.GetUniqueName("InputProc").ToString();
152-
string outputProcedureName = DataTestUtility.GetUniqueName("OutputProc").ToString();
151+
string inputProcedureName = DataTestUtility.GetShortName("InputProc").ToString();
152+
string outputProcedureName = DataTestUtility.GetShortName("OutputProc").ToString();
153153
const int charColumnSize = 100;
154154
const int decimalColumnPrecision = 10;
155155
const int decimalColumnScale = 4;
@@ -694,7 +694,7 @@ public void TestExecuteReader(string connection)
694694
[ClassData(typeof(AEConnectionStringProvider))]
695695
public async Task TestExecuteReaderAsyncWithLargeQuery(string connectionString)
696696
{
697-
string randomName = DataTestUtility.GetUniqueName(Guid.NewGuid().ToString().Replace("-", ""), false);
697+
string randomName = DataTestUtility.GetShortName(Guid.NewGuid().ToString().Replace("-", ""), false);
698698
if (randomName.Length > 50)
699699
{
700700
randomName = randomName.Substring(0, 50);
@@ -878,8 +878,8 @@ public void TestEnclaveStoredProceduresWithAndWithoutParameters(string connectio
878878
using SqlCommand sqlCommand = new("", sqlConnection, transaction: null,
879879
columnEncryptionSetting: SqlCommandColumnEncryptionSetting.Enabled);
880880

881-
string procWithoutParams = DataTestUtility.GetUniqueName("EnclaveWithoutParams", withBracket: false);
882-
string procWithParam = DataTestUtility.GetUniqueName("EnclaveWithParams", withBracket: false);
881+
string procWithoutParams = DataTestUtility.GetShortName("EnclaveWithoutParams", withBracket: false);
882+
string procWithParam = DataTestUtility.GetShortName("EnclaveWithParams", withBracket: false);
883883

884884
try
885885
{

src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.cs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -157,55 +157,6 @@ public void TestRoundTripWithCSPAndCertStoreProvider()
157157
}
158158
}
159159

160-
[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.AreConnStringSetupForAE))]
161-
[ClassData(typeof(AEConnectionStringProvider))]
162-
public void TestEncryptDecryptWithCSP(string connectionString)
163-
{
164-
string providerName = @"Microsoft Enhanced RSA and AES Cryptographic Provider";
165-
string keyIdentifier = DataTestUtility.GetUniqueNameForSqlServer("CSP");
166-
167-
try
168-
{
169-
CertificateUtilityWin.RSAPersistKeyInCsp(providerName, keyIdentifier);
170-
string cspPath = String.Concat(providerName, @"/", keyIdentifier);
171-
172-
SQLSetupStrategyCspExt sqlSetupStrategyCsp = new SQLSetupStrategyCspExt(cspPath);
173-
string tableName = sqlSetupStrategyCsp.CspProviderTable.Name;
174-
175-
try
176-
{
177-
using SqlConnection sqlConn = new(connectionString);
178-
sqlConn.Open();
179-
180-
Table.DeleteData(tableName, sqlConn);
181-
182-
// insert 1 row data
183-
Customer customer = new Customer(45, "Microsoft", "Corporation");
184-
185-
DatabaseHelper.InsertCustomerData(sqlConn, null, tableName, customer);
186-
187-
// Test INPUT parameter on an encrypted parameter
188-
using SqlCommand sqlCommand = new(@$"SELECT CustomerId, FirstName, LastName FROM [{tableName}] WHERE FirstName = @firstName",
189-
sqlConn, null, SqlCommandColumnEncryptionSetting.Enabled);
190-
SqlParameter customerFirstParam = sqlCommand.Parameters.AddWithValue(@"firstName", @"Microsoft");
191-
Console.WriteLine(@"Exception: {0}");
192-
customerFirstParam.Direction = System.Data.ParameterDirection.Input;
193-
194-
using SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
195-
ValidateResultSet(sqlDataReader);
196-
}
197-
finally
198-
{
199-
// clean up database resources
200-
sqlSetupStrategyCsp.Dispose();
201-
}
202-
}
203-
finally
204-
{
205-
CertificateUtilityWin.RSADeleteKeyInCsp(providerName, keyIdentifier);
206-
}
207-
}
208-
209160
/// <summary>
210161
/// Validates that the results are the ones expected.
211162
/// </summary>

0 commit comments

Comments
 (0)