From 1d7dafb0f64ab44792f54569ec5f591f0a0990a4 Mon Sep 17 00:00:00 2001 From: sfc-gh-ext-simba-lf Date: Fri, 22 Mar 2024 12:30:36 -0700 Subject: [PATCH] Create variable for max status retry --- Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs b/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs index 14d9bbe61..0f6609734 100755 --- a/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/SFDbCommandIT.cs @@ -317,13 +317,14 @@ public async Task TestFailedAsyncExecQueryThrowsErrorAsync() using (SnowflakeDbCommand cmd = (SnowflakeDbCommand)conn.CreateCommand()) { // Arrange + var statusMaxRetryCount = 5; var statusRetryCount = 0; cmd.CommandText = $"SELECT * FROM FAKE_TABLE;"; // Act var queryId = await cmd.ExecuteAsyncInAsyncMode(CancellationToken.None).ConfigureAwait(false); var queryStatus = await cmd.GetQueryStatusAsync(queryId, CancellationToken.None).ConfigureAwait(false); - while (statusRetryCount < 5 && QueryStatuses.IsStillRunning(queryStatus)) + while (statusRetryCount < statusMaxRetryCount && QueryStatuses.IsStillRunning(queryStatus)) { Thread.Sleep(1000); queryStatus = await cmd.GetQueryStatusAsync(queryId, CancellationToken.None).ConfigureAwait(false); @@ -1410,12 +1411,13 @@ public void TestFailedAsyncExecQueryThrowsError() using (SnowflakeDbCommand cmd = (SnowflakeDbCommand)conn.CreateCommand()) { // Arrange + var statusMaxRetryCount = 5; var statusRetryCount = 0; cmd.CommandText = $"SELECT * FROM FAKE_TABLE;"; // Act queryId = cmd.ExecuteInAsyncMode(); - while (statusRetryCount < 5 && QueryStatuses.IsStillRunning(cmd.GetQueryStatus(queryId))) + while (statusRetryCount < statusMaxRetryCount && QueryStatuses.IsStillRunning(cmd.GetQueryStatus(queryId))) { Thread.Sleep(1000); statusRetryCount++;