Skip to content

Commit 6df62c0

Browse files
Aniruddh25Copilot
andauthored
Increase connection timeout in DW/MSSQL test pipelines (#3132)
## Why make this change? Recent test failures show connection timeouts. The logs showed ~6-second pre-login initialization timeout, a 5-second timeout is quite aggressive — especially for a CI pipeline where the LocalDB instance may still be warming up. Hence, increasing it (e.g., Connection Timeout=30) to give the server more time to respond. Sample error: > 2026-02-13T20:59:04.0245012Z Failed TestParallelUpdateMutations > 2026-02-13T20:59:04.0245495Z Error Message: > 2026-02-13T20:59:04.0246509Z Class Initialization method Azure.DataApiBuilder.Service.Tests.SqlTests.GraphQLMutationTests.DwSqlGraphQLMutationTests.SetupAsync threw exception. Microsoft.Data.SqlClient.SqlException: Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [**Pre-Login] initialization=6070; handshake=12; .** > 2026-02-13T20:59:04.0247932Z Stack Trace: > 2026-02-13T20:59:04.0248828Z at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) > 2026-02-13T20:59:04.0250628Z at Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) > 2026-02-13T20:59:04.0251634Z at Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) > 2026-02-13T20:59:04.0252629Z at Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) > 2026-02-13T20:59:04.0253737Z at Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) > 2026-02-13T20:59:04.0254549Z at Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry, SqlConnectionOverrides overrides) > 2026-02-13T20:59:04.0255307Z at Microsoft.Data.SqlClient.SqlConnection.InternalOpenAsync(CancellationToken cancellationToken) > 2026-02-13T20:59:04.0255996Z --- End of stack trace from previous location --- > ## What is the change? Increase connection timeout value from 5 to 30 seconds for both DWSQL and MSSQL pipelines. --------- Co-authored-by: Copilot <[email protected]>
1 parent a971f79 commit 6df62c0

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

.pipelines/dwsql-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
inputs:
7676
targetType: 'inline'
7777
script: |
78-
connectionString="Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=SA;Password=$(dbPassword);MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;Encrypt=False;"
78+
connectionString="Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=SA;Password=$(dbPassword);MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=True;Encrypt=False;"
7979
echo "##vso[task.setvariable variable=data-source.connection-string;]$connectionString"
8080
8181
- task: Bash@3
@@ -157,7 +157,7 @@ jobs:
157157
# since windows needs a different string.
158158
# The variable setting on the pipeline UI sets the connection string
159159
# for the linux job above.
160-
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;
160+
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=True;
161161
InstallerUrl: https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi
162162
SqlVersionCode: '15.0'
163163

.pipelines/mssql-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
inputs:
7777
targetType: 'inline'
7878
script: |
79-
$connectionString="Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=SA;Password=$(dbPassword);MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;Encrypt=False;"
79+
$connectionString="Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=SA;Password=$(dbPassword);MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=True;Encrypt=False;"
8080
Write-Host "##vso[task.setvariable variable=data-source.connection-string]$connectionString"
8181
8282
- task: Bash@3
@@ -161,7 +161,7 @@ jobs:
161161
# since windows needs a different string.
162162
# The variable setting on the pipeline UI sets the connection string
163163
# for the linux job above.
164-
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=5;TrustServerCertificate=True;
164+
data-source.connection-string: Server=(localdb)\MSSQLLocalDB;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Connection Timeout=30;TrustServerCertificate=True;
165165
InstallerUrl: https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi
166166
SqlVersionCode: '15.0'
167167

src/Service.Tests/Multidab-config.MsSql.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://github.com/Azure/data-api-builder/releases/download/vmajor.minor.patch/dab.draft.schema.json",
33
"data-source": {
44
"database-type": "mssql",
5-
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;",
5+
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=30;",
66
"options": {
77
"set-session-context": true
88
}

src/Service.Tests/dab-config.DwSql.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://github.com/Azure/data-api-builder/releases/download/vmajor.minor.patch/dab.draft.schema.json",
33
"data-source": {
44
"database-type": "dwsql",
5-
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;",
5+
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=30;",
66
"options": {
77
"set-session-context": true
88
}

src/Service.Tests/dab-config.MsSql.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://github.com/Azure/data-api-builder/releases/download/vmajor.minor.patch/dab.draft.schema.json",
33
"data-source": {
44
"database-type": "mssql",
5-
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=5;",
5+
"connection-string": "Server=tcp:127.0.0.1,1433;Persist Security Info=False;User ID=sa;Password=REPLACEME;MultipleActiveResultSets=False;Connection Timeout=30;",
66
"options": {
77
"set-session-context": true
88
}

0 commit comments

Comments
 (0)