Skip to content

Commit d35e98d

Browse files
committed
Merge branch 'main' into merge/netfx-diagnostics
2 parents e563323 + cfaa576 commit d35e98d

File tree

77 files changed

+1006
-496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1006
-496
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
@@ -81,6 +81,11 @@ parameters:
8181
type: boolean
8282
default: false
8383

84+
# The timeout, in minutes, for each test job.
85+
- name: testsTimeout
86+
type: string
87+
default: 90
88+
8489
variables:
8590
- template: libraries/ci-build-variables.yml@self
8691

@@ -119,6 +124,7 @@ stages:
119124
parameters:
120125
debug: ${{ parameters.debug }}
121126
buildType: ${{ parameters.buildType }}
127+
testsTimeout: ${{ parameters.testsTimeout }}
122128
${{ if eq(parameters.buildType, 'Package') }}:
123129
dependsOn: build_nugets
124130

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

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

96+
# The timeout, in minutes, for each test job.
97+
- name: testsTimeout
98+
displayName: 'Tests timeout (in minutes)'
99+
type: string
100+
default: 90
101+
96102
extends:
97103
template: dotnet-sqlclient-ci-core.yml@self
98104
parameters:
@@ -106,3 +112,4 @@ extends:
106112
buildType: ${{ parameters.buildType }}
107113
buildConfiguration: ${{ parameters.buildConfiguration }}
108114
enableStressTests: ${{ parameters.enableStressTests }}
115+
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
@@ -85,6 +85,12 @@ parameters: # parameters are shown up in ADO UI in a build queue time
8585
type: boolean
8686
default: false
8787

88+
# The timeout, in minutes, for each test job.
89+
- name: testsTimeout
90+
displayName: 'Tests timeout (in minutes)'
91+
type: string
92+
default: 90
93+
8894
extends:
8995
template: dotnet-sqlclient-ci-core.yml@self
9096
parameters:
@@ -98,3 +104,4 @@ extends:
98104
buildType: ${{ parameters.buildType }}
99105
buildConfiguration: ${{ parameters.buildConfiguration }}
100106
enableStressTests: ${{ parameters.enableStressTests }}
107+
testsTimeout: ${{ parameters.testsTimeout }}

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

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

65+
# The timeout, in minutes, for each test job.
66+
- name: testsTimeout
67+
displayName: 'Tests timeout (in minutes)'
68+
type: string
69+
default: 90
70+
6571
variables:
6672
- template: /eng/pipelines/libraries/variables.yml@self
6773
- name: packageFolderName
@@ -161,6 +167,7 @@ extends:
161167
parameters:
162168
packageFolderName: $(packageFolderName)
163169
isPreview: ${{ parameters['isPreview'] }}
170+
timeout: ${{ parameters.testsTimeout }}
164171
downloadPackageStep:
165172
download: current
166173
artifact: $(packageFolderName)

src/Directory.Build.props

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,20 @@
113113
</PropertyGroup>
114114

115115
<!--
116-
For non-.NET, we explicitly set the C# language version to 13. This matches
117-
the language version used by the .NET 9 SDK, and provides helpful modern
118-
language features. While this isn't strictly supported by .NET in general,
119-
it works well in practice. There are very few C# language features that
120-
depend on SDK APIs, and we avoid them.
116+
We want to use the latest C# language regardless of target framework,
117+
so we explicitly set LangVersion for all targets.
121118
122-
For .NET, we omit this property entirely, which results in the SDK choosing
123-
the C# language version that matches the .NET version.
119+
We will roll this version forward as new C# language versions are released
120+
and associated with the newest .NET SDK we support.
124121
125122
Details here:
126123
127124
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-versioning
128125
129126
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version
130127
-->
131-
<PropertyGroup
132-
Condition="'$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))' != '.NETCoreApp'">
133-
<LangVersion>13.0</LangVersion>
128+
<PropertyGroup>
129+
<!-- The newest .NET SDK we support is .NET 9.0, which uses C# 13 -->
130+
<LangVersion>13</LangVersion>
134131
</PropertyGroup>
135132
</Project>

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ internal void Connect(ServerInfo serverInfo,
434434
false,
435435
true,
436436
fParallel,
437+
TransparentNetworkResolutionState.DisabledMode,
438+
-1,
437439
_connHandler.ConnectionOptions.IPAddressPreference,
438440
FQDNforDNSCache,
439441
ref _connHandler.pendingSQLDNSObject,
@@ -532,6 +534,8 @@ internal void Connect(ServerInfo serverInfo,
532534
true,
533535
true,
534536
fParallel,
537+
TransparentNetworkResolutionState.DisabledMode,
538+
-1,
535539
_connHandler.ConnectionOptions.IPAddressPreference,
536540
FQDNforDNSCache,
537541
ref _connHandler.pendingSQLDNSObject,

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObject.netcore.cs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal abstract partial class TdsParserStateObject
2121
// Constructors //
2222
//////////////////
2323

24-
internal TdsParserStateObject(TdsParser parser, TdsParserStateObject physicalConnection, bool async)
24+
protected TdsParserStateObject(TdsParser parser, TdsParserStateObject physicalConnection, bool async)
2525
{
2626
// Construct a MARS session
2727
Debug.Assert(parser != null, "no parser?");
@@ -57,40 +57,17 @@ internal TdsParserStateObject(TdsParser parser, TdsParserStateObject physicalCon
5757
// General methods //
5858
/////////////////////
5959

60-
internal abstract void CreatePhysicalSNIHandle(
61-
string serverName,
62-
TimeoutTimer timeout,
63-
out byte[] instanceName,
64-
out ResolvedServerSpn resolvedSpn,
65-
bool flushCache,
66-
bool async,
67-
bool fParallel,
68-
SqlConnectionIPAddressPreference iPAddressPreference,
69-
string cachedFQDN,
70-
ref SQLDNSInfo pendingDNSInfo,
71-
string serverSPN,
72-
bool isIntegratedSecurity = false,
73-
bool tlsFirst = false,
74-
string hostNameInCertificate = "",
75-
string serverCertificateFilename = "");
76-
77-
internal abstract void AssignPendingDNSInfo(string userProtocol, string DNSCacheKey, ref SQLDNSInfo pendingDNSInfo);
78-
79-
protected abstract void CreateSessionHandle(TdsParserStateObject physicalConnection, bool async);
80-
81-
protected abstract void FreeGcHandle(int remaining, bool release);
82-
8360
internal abstract uint EnableSsl(ref uint info, bool tlsFirst, string serverCertificateFilename);
8461

85-
internal abstract void Dispose();
86-
8762
internal abstract uint CheckConnection();
8863

8964
internal int DecrementPendingCallbacks(bool release)
9065
{
9166
int remaining = Interlocked.Decrement(ref _pendingCallbacks);
9267
SqlClientEventSource.Log.TryAdvancedTraceEvent("TdsParserStateObject.DecrementPendingCallbacks | ADV | State Object Id {0}, after decrementing _pendingCallbacks: {1}", _objectID, _pendingCallbacks);
68+
9369
FreeGcHandle(remaining, release);
70+
9471
// NOTE: TdsParserSessionPool may call DecrementPendingCallbacks on a TdsParserStateObject which is already disposed
9572
// This is not dangerous (since the stateObj is no longer in use), but we need to add a workaround in the assert for it
9673
Debug.Assert((remaining == -1 && SessionHandle.IsNull) || (0 <= remaining && remaining < 3), $"_pendingCallbacks values is invalid after decrementing: {remaining}");

0 commit comments

Comments
 (0)