Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ parameters:
type: string
default: empty

# The timeout, in minutes, for this job.
- name: timeout
type: string
default: 90

jobs:
- job: run_tests_package_reference
displayName: 'Run tests with package reference'
${{ if ne(parameters.dependsOn, 'empty')}}:
dependsOn: '${{parameters.dependsOn }}'

# Some of our tests take longer than the default 60 minutes to run on some
# OSes and configurations.
timeoutInMinutes: ${{ parameters.timeout }}

pool:
type: windows # read more about custom job pool types at https://aka.ms/obpipelines/yaml/jobs
isCustom: true
Expand Down
7 changes: 7 additions & 0 deletions eng/pipelines/dotnet-sqlclient-signing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
- NonOfficial
- Official

# The timeout, in minutes, for each test job.
- name: testsTimeout
displayName: 'Tests timeout (in minutes)'
type: string
default: 90

variables:
- template: /eng/pipelines/libraries/variables.yml@self
- name: packageFolderName
Expand Down Expand Up @@ -164,6 +170,7 @@ extends:
- template: eng/pipelines/common/templates/jobs/run-tests-package-reference-job.yml@self
parameters:
packageFolderName: $(packageFolderName)
timeout: ${{ parameters.testsTimeout }}
downloadPackageStep:
download: current
artifact: $(packageFolderName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,30 @@ public override uint Receive(out SNIPacket packet, int timeoutInMilliseconds)
}
finally
{
// Reset the socket timeout to Timeout.Infinite after the receive operation is done
// to avoid blocking the thread in case of a timeout error.
_socket.ReceiveTimeout = Timeout.Infinite;
const int resetTimeout = Timeout.Infinite;

try
{
// Reset the socket timeout to Timeout.Infinite after
// the receive operation is done to avoid blocking the
// thread in case of a timeout error.
_socket.ReceiveTimeout = resetTimeout;

}
catch (SocketException ex)
{
// We sometimes see setting the ReceiveTimeout fail
// on macOS. There's isn't much we can do about it
// though, so just log and move on.
SqlClientEventSource.Log.TrySNITraceEvent(
nameof(SNITCPHandle),
EventType.ERR,
"Connection Id {0}, Failed to reset socket " +
"receive timeout to {1}: {2}",
_connectionId,
resetTimeout,
ex.Message);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,28 @@ private static TokenCredentialData CreateTokenCredentialInstance(TokenCredential
defaultAzureCredentialOptions.WorkloadIdentityClientId = tokenCredentialKey._clientId;
}

return new TokenCredentialData(new DefaultAzureCredential(defaultAzureCredentialOptions), GetHash(secret));
// SqlClient is a library and provides support to acquire access
// token using 'DefaultAzureCredential' on user demand when they
// specify 'Authentication = Active Directory Default' in
// connection string.
//
// Default Azure Credential is instantiated by the calling
// application when using "Active Directory Default"
// authentication code to connect to Azure SQL instance.
// SqlClient is a library, doesn't instantiate the credential
// without running application instructions.
//
// Note that CodeQL suppression support can only detect
// suppression comments that appear immediately above the
// flagged statement, or appended to the end of the statement.
// Multi-line justifications are not supported.
//
// https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/codeql/codeql-semmle#guidance-on-suppressions
//
// CodeQL [SM05137] See above for justification.
DefaultAzureCredential cred = new(defaultAzureCredentialOptions);

return new TokenCredentialData(cred, GetHash(secret));
}

TokenCredentialOptions tokenCredentialOptions = new() { AuthorityHost = new Uri(tokenCredentialKey._authority) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
<Reference Condition="'$(TargetGroup)'=='netfx'" Include="System.Transactions" />
<PackageReference Condition="'$(TargetGroup)'=='netfx'" Include="Microsoft.SqlServer.Types" Version="$(MicrosoftSqlServerTypesVersion)" />
<PackageReference Condition="'$(TargetGroup)'=='netcoreapp'" Include="Microsoft.SqlServer.Types" Version="$(MicrosoftSqlServerTypesVersionNet)" />
<!-- Avoid transitive vulnerabilities on System.Text.Json 6.0.0 -->
<PackageReference Include="System.Text.Json" Version="$(SystemTextJsonVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<PackageReference Include="System.Data.Odbc" Version="$(SystemDataOdbcVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.Data.SqlClient.Tests
{
public class SqlConfigurableRetryLogicTest
{
[Fact]
public async void InvalidExecute()
public async Task InvalidExecute()
{
SqlRetryLogicOption option = new SqlRetryLogicOption()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void ConnectionTimeoutTest(int timeout)
[InlineData(10)]
[InlineData(5)]
[InlineData(1)]
public async void ConnectionTimeoutTestAsync(int timeout)
public async Task ConnectionTimeoutTestAsync(int timeout)
{
// Start a server with connection timeout from the inline data.
using TestTdsServer server = TestTdsServer.StartTestServer(false, false, timeout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void SqlParameterProperties(string connection)
const string firstColumnName = @"firstColumn";
const string secondColumnName = @"secondColumn";
const string thirdColumnName = @"thirdColumn";
string inputProcedureName = DataTestUtility.GetUniqueName("InputProc").ToString();
string outputProcedureName = DataTestUtility.GetUniqueName("OutputProc").ToString();
string inputProcedureName = DataTestUtility.GetShortName("InputProc").ToString();
string outputProcedureName = DataTestUtility.GetShortName("OutputProc").ToString();
const int charColumnSize = 100;
const int decimalColumnPrecision = 10;
const int decimalColumnScale = 4;
Expand Down Expand Up @@ -692,9 +692,9 @@ public void TestExecuteReader(string connection)

[ConditionalTheory(typeof(DataTestUtility), nameof(DataTestUtility.IsTargetReadyForAeWithKeyStore))]
[ClassData(typeof(AEConnectionStringProvider))]
public async void TestExecuteReaderAsyncWithLargeQuery(string connectionString)
public async Task TestExecuteReaderAsyncWithLargeQuery(string connectionString)
{
string randomName = DataTestUtility.GetUniqueName(Guid.NewGuid().ToString().Replace("-", ""), false);
string randomName = DataTestUtility.GetShortName(Guid.NewGuid().ToString().Replace("-", ""), false);
if (randomName.Length > 50)
{
randomName = randomName.Substring(0, 50);
Expand Down Expand Up @@ -878,8 +878,8 @@ public void TestEnclaveStoredProceduresWithAndWithoutParameters(string connectio
using SqlCommand sqlCommand = new("", sqlConnection, transaction: null,
columnEncryptionSetting: SqlCommandColumnEncryptionSetting.Enabled);

string procWithoutParams = DataTestUtility.GetUniqueName("EnclaveWithoutParams", withBracket: false);
string procWithParam = DataTestUtility.GetUniqueName("EnclaveWithParams", withBracket: false);
string procWithoutParams = DataTestUtility.GetShortName("EnclaveWithoutParams", withBracket: false);
string procWithParam = DataTestUtility.GetShortName("EnclaveWithParams", withBracket: false);

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void TestRoundTripWithCSPAndCertStoreProvider()
public void TestEncryptDecryptWithCSP(string connectionString)
{
string providerName = @"Microsoft Enhanced RSA and AES Cryptographic Provider";
string keyIdentifier = DataTestUtility.GetUniqueNameForSqlServer("CSP");
string keyIdentifier = DataTestUtility.GetLongName("CSP");

try
{
Expand Down
Loading
Loading