Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pbulawa committed Aug 29, 2024
1 parent bb4eb7b commit 9a569b7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ static async Task InvalidConnectionTaskAsync(string connectionString, int times)
{
// intentionally not using await so the connection
// will be disposed with invalid underlying session
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
conn.OpenAsync();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
};
// wait 100ms each time so the invalid sessions are generated
// roughly at the same speed as connections for query tasks
Expand Down
2 changes: 1 addition & 1 deletion Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
_forceTimeoutForNonLoginRequestsOnly && !message.RequestUri.AbsolutePath.Equals(RestPath.SF_LOGIN_PATH))
{
// 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.FromTicks(0);
message.Options.Set(new HttpRequestOptionsKey<TimeSpan>(BaseRestRequest.HTTP_REQUEST_TIMEOUT_KEY), TimeSpan.FromTicks(0));

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, GCP)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net481, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net472, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net462, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AZURE)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net48, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

'HttpRequestMessage' does not contain a definition for 'Options' and no accessible extension method 'Options' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 39 in Snowflake.Data.Tests/Mock/MockRetryUntilRestTimeout.cs

View workflow job for this annotation

GitHub Actions / Tests on Windows (net471, AWS)

The type or namespace name 'HttpRequestOptionsKey<>' could not be found (are you missing a using directive or an assembly reference?)
}

return await (base.SendAsync(message, restTimeout, externalCancellationToken).ConfigureAwait(false));
Expand Down
4 changes: 2 additions & 2 deletions Snowflake.Data.Tests/UnitTests/SFAzureClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ class SFAzureClientTest : SFBaseTest
SFFileMetadata _fileMetadata;

[SetUp]
public void BeforeTest()
public new void BeforeTest()
{
t_downloadFileName = TestNameWithWorker + "_mockFileName.txt";

_fileMetadata = new SFFileMetadata()
{
stageInfo = new PutGetStageInfo()
Expand Down
4 changes: 2 additions & 2 deletions Snowflake.Data.Tests/UnitTests/SFGCSClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class SFGCSClientTest : SFBaseTest
SFFileMetadata _fileMetadata;

[SetUp]
public void BeforeTest()
public new void BeforeTest()
{
t_downloadFileName = TestNameWithWorker + "_mockFileName.txt";

_fileMetadata = new SFFileMetadata()
{
stageInfo = new PutGetStageInfo()
Expand Down
30 changes: 16 additions & 14 deletions Snowflake.Data.Tests/UnitTests/SFReusableChunkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ public void TestExtractCellWithRowParameterReadsAllRows()
string data = "[ [\"1\", \"1.234\", \"abcde\"], [\"2\", \"5.678\", \"fghi\"] ]";
var chunk = PrepareChunkAsync(data, 3, 2).Result;

#pragma warning disable CS0618 // Type or member is obsolete
Assert.AreEqual("1", chunk.ExtractCell(0,0).SafeToString());
Assert.AreEqual("1.234", chunk.ExtractCell(0, 1).SafeToString());
Assert.AreEqual("abcde", chunk.ExtractCell(0, 2).SafeToString());

Assert.AreEqual("2", chunk.ExtractCell(1, 0).SafeToString());
Assert.AreEqual("5.678", chunk.ExtractCell(1, 1).SafeToString());
Assert.AreEqual("fghi", chunk.ExtractCell(1, 2).SafeToString());
#pragma warning restore CS0618 // Type or member is obsolete
}

[Test]
Expand All @@ -42,7 +44,7 @@ public void TestSimpleChunk()
Assert.AreEqual("1", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("1.234", chunk.ExtractCell(1).SafeToString());
Assert.AreEqual("abcde", chunk.ExtractCell(2).SafeToString());

chunk.Next();
Assert.AreEqual("2", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("5.678", chunk.ExtractCell(1).SafeToString());
Expand All @@ -59,7 +61,7 @@ public void TestChunkWithNull()
Assert.AreEqual(null, chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("1.234", chunk.ExtractCell(1).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(2).SafeToString());

chunk.Next();
Assert.AreEqual("2", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(1).SafeToString());
Expand All @@ -76,7 +78,7 @@ public void TestChunkWithDate()
Assert.AreEqual(null, chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("2019-08-21T11:58:00", chunk.ExtractCell(1).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(2).SafeToString());

chunk.Next();
Assert.AreEqual("2", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(1).SafeToString());
Expand All @@ -93,7 +95,7 @@ public void TestChunkWithEscape()
Assert.AreEqual("\\åäö\nÅÄÖ\r", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("1.234", chunk.ExtractCell(1).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(2).SafeToString());

chunk.Next();
Assert.AreEqual("2", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(1).SafeToString());
Expand All @@ -111,7 +113,7 @@ public void TestChunkWithLongString()
Assert.AreEqual("åäö\nÅÄÖ\r", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual("1.234", chunk.ExtractCell(1).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(2).SafeToString());

chunk.Next();
Assert.AreEqual("2", chunk.ExtractCell(0).SafeToString());
Assert.AreEqual(null, chunk.ExtractCell(1).SafeToString());
Expand Down Expand Up @@ -140,7 +142,7 @@ public async Task TestParserError2()
{
// Unterminated string
string data = "[ [\"åäö";

try
{
await PrepareChunkAsync(data, 1, 1);
Expand Down Expand Up @@ -177,7 +179,7 @@ public void TestNextIteratesThroughAllRecords()
}
Assert.IsFalse(chunk.Next());
}

[Test]
public void TestRewindIteratesThroughAllRecords()
{
Expand All @@ -190,14 +192,14 @@ public void TestRewindIteratesThroughAllRecords()
chunk.Next();
}
chunk.Next();

for (var i = 0; i < RowCount; ++i)
{
Assert.IsTrue(chunk.Rewind());
}
Assert.IsFalse(chunk.Rewind());
}

[Test]
public void TestResetClearsChunkData()
{
Expand All @@ -211,14 +213,14 @@ public void TestResetClearsChunkData()
uncompressedSize = 100,
rowCount = 200
};

chunk.Reset(chunkInfo, 0);

Assert.AreEqual(0, chunk.ChunkIndex);
Assert.AreEqual(chunkInfo.url, chunk.Url);
Assert.AreEqual(chunkInfo.rowCount, chunk.RowCount);
}

private async Task<SFReusableChunk> PrepareChunkAsync(string stringData, int colCount, int rowCount)
{
byte[] bytes = Encoding.UTF8.GetBytes(stringData);
Expand All @@ -234,7 +236,7 @@ private async Task<SFReusableChunk> PrepareChunkAsync(string stringData, int col

SFReusableChunk chunk = new SFReusableChunk(colCount);
chunk.Reset(chunkInfo, 0);

await parser.ParseChunk(chunk);
return chunk;
}
Expand Down
8 changes: 4 additions & 4 deletions Snowflake.Data.Tests/UnitTests/SFS3ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ class SFS3ClientTest : SFBaseTest
AmazonS3Config _clientConfig;

[SetUp]
public void BeforeTest()
public new void BeforeTest()
{
t_downloadFileName = TestNameWithWorker + "_mockFileName.txt";

_fileMetadata = new SFFileMetadata()
{
stageInfo = new PutGetStageInfo()
Expand Down Expand Up @@ -274,7 +274,7 @@ public async Task TestUploadFileAsync(string requestKey, ResultStatus expectedRe
iv = MockS3Client.AmzIV,
key = MockS3Client.AmzKey,
matDesc = MockS3Client.AmzMatdesc
},
},
_cancellationToken).ConfigureAwait(false);

// Assert
Expand Down Expand Up @@ -331,7 +331,7 @@ public async Task TestDownloadFileAsync(string requestKey, ResultStatus expected
_client = new SFS3Client(_fileMetadata.stageInfo, MaxRetry, Parallel, _proxyCredentials, mockAmazonS3Client.Object);
_fileMetadata.client = _client;
_fileMetadata.stageInfo.location = requestKey;

// Act
await _client.DownloadFileAsync(_fileMetadata, t_downloadFileName, Parallel, _cancellationToken).ConfigureAwait(false);

Expand Down

0 comments on commit 9a569b7

Please sign in to comment.