Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling empty response TryReadStringArrayWithLengthHeader #1009

Merged
merged 13 commits into from
Feb 14, 2025
16 changes: 16 additions & 0 deletions test/Garnet.test/GarnetClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,22 @@
ClassicAssert.AreEqual("Hello", resultMykey);
}

[Test]
public async Task ShouldNotThrowExceptionForEmptyArrayResponse()

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Debug, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Debug, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Debug, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Debug, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Release, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Release, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Release, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (ubuntu-latest, net8.0, Release, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Debug, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Debug, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Debug, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Debug, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Release, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Release, Garnet.test)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Release, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 358 in test/Garnet.test/GarnetClientTests.cs

View workflow job for this annotation

GitHub Actions / Garnet (windows-latest, net8.0, Release, Garnet.test.cluster)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
using var server = TestUtils.CreateGarnetServer(TestUtils.MethodTestDir);
server.Start();

using var db = TestUtils.GetGarnetClient();
db.Connect();

ClassicAssert.DoesNotThrowAsync(async () =>
{
var result = await db.ExecuteForStringResultAsync("KEYS", ["*"]);
ClassicAssert.IsNull(result);
});
}

[Test]
public async Task CanUseMGetTests([Values] bool disableObjectStore)
{
Expand Down