diff --git a/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs index 98e9af7c1..8532b3bb0 100755 --- a/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs @@ -229,9 +229,6 @@ public void TestSimpleLargeResultSet() } - /* - * Disabled to make sure that configuration changes does not cause problems with appveyor - */ [Test, NonParallelizable] public void TestUseV1ResultParser() { diff --git a/Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs b/Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs index 8d27a00aa..8397b7145 100644 --- a/Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs +++ b/Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs @@ -31,7 +31,7 @@ protected override async Task SendAsync(HttpRequestMessage string sid = "") { // Override the http timeout and set to 1ms to force all http request to timeout and retry - message.Properties[BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY] = TimeSpan.FromMilliseconds(1); + message.Properties[BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY] = TimeSpan.FromTicks(0);; return await (base.SendAsync(message, restTimeout, externalCancellationToken).ConfigureAwait(false)); } } diff --git a/Snowflake.Data.Tests/Mock/MockSnowflakeDbConnection.cs b/Snowflake.Data.Tests/Mock/MockSnowflakeDbConnection.cs index aa342fe68..0f1758636 100644 --- a/Snowflake.Data.Tests/Mock/MockSnowflakeDbConnection.cs +++ b/Snowflake.Data.Tests/Mock/MockSnowflakeDbConnection.cs @@ -92,5 +92,10 @@ private void OnSessionEstablished() { _connectionState = ConnectionState.Open; } + + protected override bool CanReuseSession(TransactionRollbackStatus transactionRollbackStatus) + { + return false; + } } } diff --git a/Snowflake.Data/Client/SnowflakeDbConnection.cs b/Snowflake.Data/Client/SnowflakeDbConnection.cs index b611589cf..5f66d340c 100755 --- a/Snowflake.Data/Client/SnowflakeDbConnection.cs +++ b/Snowflake.Data/Client/SnowflakeDbConnection.cs @@ -37,7 +37,7 @@ public class SnowflakeDbConnection : DbConnection // Will fix that in a separated PR though as it's a different issue private static Boolean _isArrayBindStageCreated; - private enum TransactionRollbackStatus + protected enum TransactionRollbackStatus { Undefined, // used to indicate ignored transaction status when pool disabled Success, @@ -232,7 +232,7 @@ public Task CloseAsync(CancellationToken cancellationToken) return taskCompletionSource.Task; } - private bool CanReuseSession(TransactionRollbackStatus transactionRollbackStatus) + protected virtual bool CanReuseSession(TransactionRollbackStatus transactionRollbackStatus) { return SnowflakeDbConnectionPool.GetPooling() && transactionRollbackStatus == TransactionRollbackStatus.Success; diff --git a/Snowflake.Data/Core/HttpUtil.cs b/Snowflake.Data/Core/HttpUtil.cs index 0daab0ab6..77d3807ff 100755 --- a/Snowflake.Data/Core/HttpUtil.cs +++ b/Snowflake.Data/Core/HttpUtil.cs @@ -364,7 +364,10 @@ protected override async Task SendAsync(HttpRequestMessage if (!httpTimeout.Equals(Timeout.InfiniteTimeSpan)) { childCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - childCts.CancelAfter(httpTimeout); + if (httpTimeout.Ticks == 0) + childCts.Cancel(); + else + childCts.CancelAfter(httpTimeout); } response = await base.SendAsync(requestMessage, childCts == null ? cancellationToken : childCts.Token).ConfigureAwait(false);