diff --git a/Directory.Packages.props b/Directory.Packages.props
index 7f761e3d576..c917e3623e0 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -25,7 +25,7 @@
-
+
diff --git a/test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs b/test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs
index b23d70fab18..1c3f53e2c54 100644
--- a/test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs
+++ b/test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs
@@ -647,7 +647,7 @@ public void ClusterSimpleMigrateSlotsExpiry()
try
{
- var result = (string)server.Execute("zadd", args);
+ var result = (string)server.Execute(0, "zadd", args);
data.Sort((x, y) => x.Item1.CompareTo(y.Item1));
return (result, data);
}
@@ -672,7 +672,7 @@ private string DoZCOUNT(int nodeIndex, byte[] key, out int count, out string add
try
{
- var result = server.Execute("zcount", args, CommandFlags.NoRedirect);
+ var result = server.Execute(0, "zcount", args, CommandFlags.NoRedirect);
count = int.Parse((string)result);
address = ((IPEndPoint)server.EndPoint).Address.ToString();
port = ((IPEndPoint)server.EndPoint).Port;
@@ -725,7 +725,7 @@ private string DoZCOUNT(int nodeIndex, byte[] key, out int count, out string add
];
try
{
- var result = server.Execute("zrange", args, CommandFlags.NoRedirect);
+ var result = server.Execute(0, "zrange", args, CommandFlags.NoRedirect);
address = ((IPEndPoint)server.EndPoint).Address.ToString();
port = ((IPEndPoint)server.EndPoint).Port;
slot = ClusterTestUtils.HashSlot(key);
@@ -2183,9 +2183,9 @@ public void ClusterMigrateSetCopyUpdate(CancellationToken cancellationToken)
foreach (var value in values)
{
- var result = (string)sourceServer.Execute("set", key, value);
+ var result = (string)sourceServer.Execute(0, "set", [key, value]);
ClassicAssert.AreEqual("OK", result);
- result = (string)sourceServer.Execute("get", key);
+ result = (string)sourceServer.Execute(0, "get", [key]);
ClassicAssert.AreEqual(Encoding.ASCII.GetString(value), result);
}
@@ -2204,9 +2204,9 @@ public void ClusterMigrateSetCopyUpdate(CancellationToken cancellationToken)
values = context.GenerateIncreasingSizeValues(6, 7);
foreach (var value in values)
{
- var result = (string)sourceServer.Execute("set", key, value);
+ var result = (string)sourceServer.Execute(0, "set", [key, value]);
ClassicAssert.AreEqual("OK", result);
- result = (string)sourceServer.Execute("get", key);
+ result = (string)sourceServer.Execute(0, "get", [key]);
ClassicAssert.AreEqual(Encoding.ASCII.GetString(value), result);
}
@@ -2223,7 +2223,7 @@ public void ClusterMigrateSetCopyUpdate(CancellationToken cancellationToken)
foreach (var value in values)
{
- var result = (string)targetServer.Execute("get", key);
+ var result = (string)targetServer.Execute(0, "get", [key]);
ClassicAssert.AreEqual(Encoding.ASCII.GetString(value), result);
}
}
@@ -2255,9 +2255,9 @@ public void ClusterMigrateCustomProcDelRMW(CancellationToken cancellationToken)
var value = "12345";
var value2 = "67890";
var slot = HashSlotUtils.HashSlot(Encoding.ASCII.GetBytes(key));
- var resp = sourceServer.Execute("set", key, value);
+ var resp = sourceServer.Execute(0, "set", [key, value]);
ClassicAssert.AreEqual("OK", (string)resp);
- resp = sourceServer.Execute("get", key);
+ resp = sourceServer.Execute(0, "get", [key]);
ClassicAssert.AreEqual(value, (string)resp);
try
@@ -2273,7 +2273,7 @@ public void ClusterMigrateCustomProcDelRMW(CancellationToken cancellationToken)
}
// At this point we should have switched to MIGRATING state but not yet started migration, hence we can still operate on the key
- _ = sourceServer.Execute("DELRMW", [key, value2]);
+ _ = sourceServer.Execute(0, "DELRMW", [key, value2]);
// Re-enable to signal migration to continue
ExceptionInjectionHelper.EnableException(ExceptionInjectionType.Migration_Slot_End_Scan_Range_Acquisition);
@@ -2286,7 +2286,7 @@ public void ClusterMigrateCustomProcDelRMW(CancellationToken cancellationToken)
ExceptionInjectionHelper.DisableException(ExceptionInjectionType.Migration_Slot_End_Scan_Range_Acquisition);
}
- resp = targetServer.Execute("get", key);
+ resp = targetServer.Execute(0, "get", [key]);
ClassicAssert.AreEqual(value2, (string)resp);
}
#endif
@@ -2337,7 +2337,7 @@ public void ClusterMigrateSlotsWithHostname()
try
{
- var resp = server.Execute("migrate", args);
+ var resp = server.Execute(0, "migrate", args);
ClassicAssert.AreEqual("OK", (string)resp);
}
catch (Exception ex)
@@ -2405,7 +2405,7 @@ public void ClusterMigrateWithInvalidHostname()
try
{
- var resp = server.Execute("migrate", args);
+ var resp = server.Execute(0, "migrate", args);
Assert.Fail($"Migration with invalid hostname '{invalidHostname}' should fail");
}
catch (RedisServerException ex)
@@ -2595,10 +2595,10 @@ public void ClusterDelKeysInSlotRemovesStringAndObjectKeys()
context.clusterTestUtils.RandomBytesRestrictedToSlot(ref keepObjectKey, keepSlot);
var server = context.clusterTestUtils.GetServer(0);
- _ = server.Execute("SET", delStringKey, "raw-del");
- _ = server.Execute("SADD", delObjectKey, "del-m1", "del-m2", "del-m3");
- _ = server.Execute("SET", keepStringKey, "raw-keep");
- _ = server.Execute("SADD", keepObjectKey, "keep-m1", "keep-m2", "keep-m3");
+ _ = server.Execute(0, "SET", [delStringKey, "raw-del"]);
+ _ = server.Execute(0, "SADD", [delObjectKey, "del-m1", "del-m2", "del-m3"]);
+ _ = server.Execute(0, "SET", [keepStringKey, "raw-keep"]);
+ _ = server.Execute(0, "SADD", [keepObjectKey, "keep-m1", "keep-m2", "keep-m3"]);
// Both slots should each contain their two keys before deletion.
ClassicAssert.AreEqual(2, context.clusterTestUtils.CountKeysInSlot(0, delSlot, context.logger),
@@ -2620,17 +2620,17 @@ public void ClusterDelKeysInSlotRemovesStringAndObjectKeys()
"Keys in keepSlot must NOT be collateral-deleted by DELKEYSINSLOT on delSlot");
// Direct GET / EXISTS confirm the delSlot keys are gone.
- var delStringRes = server.Execute("GET", delStringKey);
+ var delStringRes = server.Execute(0, "GET", [delStringKey]);
ClassicAssert.IsTrue(delStringRes.IsNull, "delSlot string key should no longer exist after DELKEYSINSLOT");
- var delObjectRes = (long)server.Execute("EXISTS", delObjectKey);
+ var delObjectRes = (long)server.Execute(0, "EXISTS", [delObjectKey]);
ClassicAssert.AreEqual(0, delObjectRes, "delSlot object key should no longer exist after DELKEYSINSLOT");
// Direct GET / EXISTS confirm the keepSlot keys still exist with their original payloads.
- var keepStringRes = (string)server.Execute("GET", keepStringKey);
+ var keepStringRes = (string)server.Execute(0, "GET", [keepStringKey]);
ClassicAssert.AreEqual("raw-keep", keepStringRes, "keepSlot string key value should be unchanged");
- var keepObjectExists = (long)server.Execute("EXISTS", keepObjectKey);
+ var keepObjectExists = (long)server.Execute(0, "EXISTS", [keepObjectKey]);
ClassicAssert.AreEqual(1, keepObjectExists, "keepSlot object key should still exist after DELKEYSINSLOT");
- var keepObjectCard = (long)server.Execute("SCARD", keepObjectKey);
+ var keepObjectCard = (long)server.Execute(0, "SCARD", [keepObjectKey]);
ClassicAssert.AreEqual(3, keepObjectCard, "keepSlot object key should still contain all 3 members");
}
}
diff --git a/test/cluster/Garnet.test.cluster.migrate/RedirectTests/ClusterSlotVerificationTests.cs b/test/cluster/Garnet.test.cluster.migrate/RedirectTests/ClusterSlotVerificationTests.cs
index 4b16070f8a0..825000a2335 100644
--- a/test/cluster/Garnet.test.cluster.migrate/RedirectTests/ClusterSlotVerificationTests.cs
+++ b/test/cluster/Garnet.test.cluster.migrate/RedirectTests/ClusterSlotVerificationTests.cs
@@ -320,7 +320,7 @@ public void ClusterCLUSTERDOWNTest()
void SERedisClusterDown(BaseCommand command)
{
AssertSlotsNotAssigned(requestNodeIndex);
- var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotRequest()),
+ var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotRequest()),
$"Expected exception was not thrown. Command: {command.Command} \n{ClusterState()}");
ClassicAssert.AreEqual("CLUSTERDOWN Hash slot not served", ex.Message, command.Command);
}
@@ -353,7 +353,7 @@ public void ClusterOKTest()
try
{
- var resp = (string)context.clusterTestUtils.GetServer(requestNodeIndex).Execute("DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
+ var resp = (string)context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, "DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
}
catch (Exception ex)
{
@@ -367,11 +367,11 @@ void SERedisOKTest(BaseCommand command)
{
if (command.RequiresObjectParameters)
{
- _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotObjectRequest());
+ _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotObjectRequest());
}
else
{
- _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotRequest());
+ _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotRequest());
}
}
catch (Exception ex)
@@ -423,7 +423,7 @@ void SERedisCrossslotTest(BaseCommand command)
{
if (!command.IsArrayCommand)
return;
- var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetCrossSlotRequest()),
+ var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetCrossSlotRequest()),
$"Expected exception was not thrown. Command: {command.Command} \n{ClusterState()}");
ClassicAssert.AreEqual("CROSSSLOT Keys in request do not hash to the same slot", ex.Message, command.Command);
}
@@ -460,7 +460,7 @@ public void ClusterMOVEDTest()
void SERedisMOVEDTest(BaseCommand command)
{
- var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
+ var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
$"Expected exception was not thrown. Command: {command.Command} \n{ClusterState()}");
ClassicAssert.IsTrue(ex.Message.StartsWith("Key has MOVED"), command.Command);
var tokens = ex.Message.Split(' ');
@@ -511,7 +511,7 @@ public void ClusterASKTest()
ResetSlot();
try
{
- var resp = (string)context.clusterTestUtils.GetServer(requestNodeIndex).Execute("DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
+ var resp = (string)context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, "DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
}
catch (Exception ex)
{
@@ -522,7 +522,7 @@ public void ClusterASKTest()
void SERedisASKTest(BaseCommand command)
{
- var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
+ var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
$"Expected exception was not thrown. Command: {command.Command} \n{ClusterState()}");
var tokens = ex.Message.Split(' ');
ClassicAssert.IsTrue(tokens.Length > 10 && tokens[0].Equals("Endpoint"), command.Command + " => " + ex.Message);
@@ -568,7 +568,7 @@ void SERedisTRYAGAINTest(BaseCommand command)
var setupParameters = setup.Slice(1).ToArray();
try
{
- _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(setup[0], setupParameters, CommandFlags.NoRedirect);
+ _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, setup[0], setupParameters, CommandFlags.NoRedirect);
}
catch (Exception ex)
{
@@ -580,7 +580,7 @@ void SERedisTRYAGAINTest(BaseCommand command)
ConfigureSlotForMigration();
try
{
- var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
+ var ex = Assert.Throws(() => context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, command.Command, command.GetSingleSlotRequest(), CommandFlags.NoRedirect),
$"Expected exception was not thrown. Command: {command.Command} \n{ClusterState()}");
ClassicAssert.AreEqual("TRYAGAIN Multiple keys request during rehashing of slot", ex.Message, command.Command, $"\n{ClusterState()}");
}
@@ -589,7 +589,7 @@ void SERedisTRYAGAINTest(BaseCommand command)
ResetSlot();
try
{
- _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute("DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
+ _ = context.clusterTestUtils.GetServer(requestNodeIndex).Execute(0, "DEL", [.. command.GetSingleSlotKeys], CommandFlags.NoRedirect);
}
catch (Exception ex)
{
diff --git a/test/cluster/Garnet.test.cluster.multilog/MultiLogTests/ClusterReplicationShardedLog.cs b/test/cluster/Garnet.test.cluster.multilog/MultiLogTests/ClusterReplicationShardedLog.cs
index e5728fb54bd..2be80e64df1 100644
--- a/test/cluster/Garnet.test.cluster.multilog/MultiLogTests/ClusterReplicationShardedLog.cs
+++ b/test/cluster/Garnet.test.cluster.multilog/MultiLogTests/ClusterReplicationShardedLog.cs
@@ -201,7 +201,7 @@ public async Task ClusterReplicationShardedLogRecoverAsync()
context.PopulatePrimary(ref context.kvPairs, keyLength, kvpairCount, 0);
var primaryServer = context.clusterTestUtils.GetServer(primaryNodeIndex);
- var expectedKeys = (string[])primaryServer.Execute("KEYS", ["*"]);
+ var expectedKeys = (string[])primaryServer.Execute(0, "KEYS", ["*"]);
await context.nodes[primaryNodeIndex].Store.CommitAOFAsync(default).ConfigureAwait(false);
// Shutdown node
@@ -220,7 +220,7 @@ public async Task ClusterReplicationShardedLogRecoverAsync()
context.CreateConnection(useTLS: useTLS);
primaryServer = context.clusterTestUtils.GetServer(primaryNodeIndex);
- var keys = (string[])primaryServer.Execute("KEYS", ["*"]);
+ var keys = (string[])primaryServer.Execute(0, "KEYS", ["*"]);
Array.Sort(keys);
Array.Sort(expectedKeys);
ClassicAssert.AreEqual(expectedKeys.Length, keys.Length);
diff --git a/test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs b/test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs
index 60ad23ef8cf..edff700fa70 100644
--- a/test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs
+++ b/test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs
@@ -1192,14 +1192,14 @@ public void ClusterReplicationLua([Values] bool luaTransactionMode)
_ = context.clusterTestUtils.SimpleSetupCluster(primary_count, replica_count, logger: context.logger);
var primaryServer = context.clusterTestUtils.GetServer(primaryNodeIndex);
- _ = primaryServer.Execute("EVAL", "redis.call('SET', KEYS[1], ARGV[1])", "1", "foo", "bar");
- _ = primaryServer.Execute("EVAL", "redis.call('SET', KEYS[1], ARGV[1])", "1", "fizz", "buzz");
+ _ = primaryServer.Execute(0, "EVAL", ["redis.call('SET', KEYS[1], ARGV[1])", "1", "foo", "bar"]);
+ _ = primaryServer.Execute(0, "EVAL", ["redis.call('SET', KEYS[1], ARGV[1])", "1", "fizz", "buzz"]);
context.clusterTestUtils.WaitForReplicaAofSync(primaryNodeIndex, replicaNodeIndex, context.logger);
var replicaServer = context.clusterTestUtils.GetServer(replicaNodeIndex);
- var res1 = (string)replicaServer.Execute("EVAL", "return redis.call('GET', KEYS[1])", "1", "foo");
- var res2 = (string)replicaServer.Execute("EVAL", "return redis.call('GET', KEYS[1])", "1", "fizz");
+ var res1 = (string)replicaServer.Execute(0, "EVAL", ["return redis.call('GET', KEYS[1])", "1", "foo"]);
+ var res2 = (string)replicaServer.Execute(0, "EVAL", ["return redis.call('GET', KEYS[1])", "1", "fizz"]);
ClassicAssert.AreEqual("bar", res1);
ClassicAssert.AreEqual("buzz", res2);
@@ -1268,14 +1268,14 @@ public void ClusterReplicationStoredProc([Values] bool enableDisklessSync, [Valu
ClusterReplicate();
// Validate primary keys
- var resp = primaryServer.Execute("KEYS", ["*"]);
+ var resp = primaryServer.Execute(0, "KEYS", ["*"]);
ClassicAssert.AreEqual(expectedKeys, (string[])resp);
context.clusterTestUtils.WaitForReplicaAofSync(primaryNodeIndex, replicaNodeIndex, context.logger);
replicaServer = context.clusterTestUtils.GetServer(replicaNodeIndex);
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(30));
while (true)
{
- resp = replicaServer.Execute("KEYS", ["*"]);
+ resp = replicaServer.Execute(0, "KEYS", ["*"]);
if (expectedKeys.Length == ((string[])resp).Length)
break;
ClusterTestUtils.BackOff(cts.Token);
@@ -1287,9 +1287,9 @@ public void ClusterReplicationStoredProc([Values] bool enableDisklessSync, [Valu
void ExecuteRateLimit()
{
- var resp = primaryServer.Execute("RATELIMIT", [expectedKeys[0], "1000000000", "1000000000"]);
+ var resp = primaryServer.Execute(0, "RATELIMIT", [expectedKeys[0], "1000000000", "1000000000"]);
ClassicAssert.AreEqual("ALLOWED", (string)resp);
- resp = primaryServer.Execute("RATELIMIT", [expectedKeys[1], "1000000000", "1000000000"]);
+ resp = primaryServer.Execute(0, "RATELIMIT", [expectedKeys[1], "1000000000", "1000000000"]);
ClassicAssert.AreEqual("ALLOWED", (string)resp);
}
@@ -1519,9 +1519,9 @@ void RunWorkload(int start, int count)
while (start++ < end)
{
var key = start.ToString();
- var resp = primaryServer.Execute("SET", [key, key]);
+ var resp = primaryServer.Execute(0, "SET", [key, key]);
ClassicAssert.AreEqual("OK", (string)resp);
- resp = primaryServer.Execute("GET", key);
+ resp = primaryServer.Execute(0, "GET", [key]);
ClassicAssert.AreEqual(key, (string)resp);
}
}
@@ -1566,8 +1566,8 @@ async Task RestartRecover(int iteration)
void ValidateKeys()
{
- var resp = (string[])primaryServer.Execute("KEYS", ["*"]);
- var resp2 = (string[])replicaServer.Execute("KEYS", ["*"]);
+ var resp = (string[])primaryServer.Execute(0, "KEYS", ["*"]);
+ var resp2 = (string[])replicaServer.Execute(0, "KEYS", ["*"]);
ClassicAssert.AreEqual(resp.Length, resp2.Length);
Array.Sort(resp);
Array.Sort(resp2);
@@ -1660,17 +1660,17 @@ void RunWorkload(IServer server, int start, int count)
while (start++ < end)
{
var key = start.ToString();
- var resp = server.Execute("SET", [key, key]);
+ var resp = server.Execute(0, "SET", [key, key]);
ClassicAssert.AreEqual("OK", (string)resp);
- resp = server.Execute("GET", key);
+ resp = server.Execute(0, "GET", [key]);
ClassicAssert.AreEqual(key, (string)resp);
}
}
void ValidateKeys()
{
- var resp = (string[])primaryServer.Execute("KEYS", ["*"]);
- var resp2 = (string[])replicaServer.Execute("KEYS", ["*"]);
+ var resp = (string[])primaryServer.Execute(0, "KEYS", ["*"]);
+ var resp2 = (string[])replicaServer.Execute(0, "KEYS", ["*"]);
ClassicAssert.AreEqual(resp.Length, resp2.Length);
Array.Sort(resp);
Array.Sort(resp2);
diff --git a/test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs b/test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs
index 3a74b21501a..3bf35f61efd 100644
--- a/test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs
+++ b/test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs
@@ -2345,14 +2345,14 @@ public async Task VSETATTRReplicatesAsync()
var primaryServer = connection.GetServer(primary);
var secondaryServer = connection.GetServer(secondary);
- var addRes = (int)await primaryServer.ExecuteAsync("VADD", [Key, "VALUES", "3", "1", "2", "3", Element]).ConfigureAwait(false);
+ var addRes = (int)await primaryServer.ExecuteAsync(0, "VADD", [Key, "VALUES", "3", "1", "2", "3", Element]).ConfigureAwait(false);
ClassicAssert.AreEqual(1, addRes);
- var setRes = (int)await primaryServer.ExecuteAsync("VSETATTR", [Key, Element, "{\"foo\":\"bar\"}"]).ConfigureAwait(false);
+ var setRes = (int)await primaryServer.ExecuteAsync(0, "VSETATTR", [Key, Element, "{\"foo\":\"bar\"}"]).ConfigureAwait(false);
ClassicAssert.AreEqual(1, setRes);
context.clusterTestUtils.WaitForReplicaAofSync(PrimaryIndex, SecondaryIndex);
- var getRes = (string)await secondaryServer.ExecuteAsync("VGETATTR", [Key, Element]).ConfigureAwait(false);
+ var getRes = (string)await secondaryServer.ExecuteAsync(0, "VGETATTR", [Key, Element]).ConfigureAwait(false);
ClassicAssert.AreEqual("{\"foo\":\"bar\"}", getRes);
}
diff --git a/test/cluster/Garnet.test.cluster/ClusterManagementTests.cs b/test/cluster/Garnet.test.cluster/ClusterManagementTests.cs
index d00d545f606..f0c333c4f1d 100644
--- a/test/cluster/Garnet.test.cluster/ClusterManagementTests.cs
+++ b/test/cluster/Garnet.test.cluster/ClusterManagementTests.cs
@@ -339,8 +339,8 @@ public void ClusterResetFailsForMasterWithKeysInSlotsTest()
byte[] key = new byte[16];
context.clusterTestUtils.RandomBytesRestrictedToSlot(ref key, node.Slots.First().From);
- context.clusterTestUtils.GetServer(0).Execute("SET", key, "1234");
- string res = context.clusterTestUtils.GetServer(0).Execute("GET", key).ToString();
+ context.clusterTestUtils.GetServer(0).Execute(0, "SET", [key, "1234"]);
+ string res = context.clusterTestUtils.GetServer(0).Execute(0, "GET", [key]).ToString();
ClassicAssert.AreEqual("1234", res);
VerifyClusterResetFails(true);
@@ -382,7 +382,7 @@ public void ClusterResetFailsForMasterWithKeysInSlotsObjectStoreTest()
}
[Test, Order(4)]
- public void ClusterResetAfterFLushAllTest()
+ public void ClusterResetAfterFlushAllTest()
{
var node_count = 4;
context.CreateInstances(node_count);
@@ -999,17 +999,17 @@ public void ClusterFlushAll()
var value = "myvalue";
// Set value
- var result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute("SET", key, value);
+ var result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute(0, "SET", [key, value]);
ClassicAssert.AreEqual("OK", result);
// Get value
- result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute("GET", key);
+ result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute(0, "GET", [key]);
ClassicAssert.AreEqual(value, result);
// Get value from replica
while (true)
{
- result = (string)context.clusterTestUtils.GetServer(replicaIndex).Execute("GET", key);
+ result = (string)context.clusterTestUtils.GetServer(replicaIndex).Execute(0, "GET", [key]);
if (result == value)
break;
}
@@ -1023,13 +1023,13 @@ public void ClusterFlushAll()
Assert.DoesNotThrow(() => context.clusterTestUtils.GetServer(primaryIndex).FlushAllDatabases());
// Get value
- result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute("GET", key);
+ result = (string)context.clusterTestUtils.GetServer(primaryIndex).Execute(0, "GET", [key]);
ClassicAssert.IsNull(result);
// Get value from replica
while (true)
{
- result = (string)context.clusterTestUtils.GetServer(replicaIndex).Execute("GET", key);
+ result = (string)context.clusterTestUtils.GetServer(replicaIndex).Execute(0, "GET", [key]);
if (result == null)
break;
}
@@ -1130,13 +1130,13 @@ void ExecuteHashSet(string key, HashEntry[] elements)
{
db.HashSet(key, elements);
- var result = primaryServer.Execute("HPEXPIRE", key, "500", "FIELDS", "2", "field1", "field2");
+ var result = primaryServer.Execute(0, "HPEXPIRE", [key, "500", "FIELDS", "2", "field1", "field2"]);
var results = (RedisResult[])result;
ClassicAssert.AreEqual(2, results.Length);
ClassicAssert.AreEqual(1, (long)results[0]);
ClassicAssert.AreEqual(1, (long)results[1]);
- result = primaryServer.Execute("HPEXPIRE", key, "500", "FIELDS", "2", "field3", "field4");
+ result = primaryServer.Execute(0, "HPEXPIRE", [key, "500", "FIELDS", "2", "field3", "field4"]);
results = (RedisResult[])result;
ClassicAssert.AreEqual(2, results.Length);
ClassicAssert.AreEqual(1, (long)results[0]);
@@ -1149,7 +1149,7 @@ void ValidateHashSet(string key)
var expectedFieldsAndValues = elements.AsSpan().Slice(4).ToArray()
.SelectMany(e => new[] { e.Name.ToString(), e.Value.ToString() })
.ToArray();
- var fields = (string[])primaryServer.Execute("HGETALL", [key]);
+ var fields = (string[])primaryServer.Execute(0, "HGETALL", [key]);
ClassicAssert.AreEqual(4, fields.Length);
ClassicAssert.AreEqual(expectedFieldsAndValues, fields);
@@ -1157,7 +1157,7 @@ void ValidateHashSet(string key)
context.clusterTestUtils.WaitForReplicaAofSync(primaryNodeIndex, replicaNodeIndex, context.logger, cancellationToken);
// Check if replica is caught up
- fields = (string[])replicaServer.Execute("HGETALL", [key]);
+ fields = (string[])replicaServer.Execute(0, "HGETALL", [key]);
ClassicAssert.AreEqual(4, fields.Length);
ClassicAssert.AreEqual(expectedFieldsAndValues, fields);
}
@@ -1166,10 +1166,10 @@ void ManualCollect()
{
if (useManualCollect)
{
- Assert.Throws(() => replicaServer.Execute("HCOLLECT", ["*"], CommandFlags.NoRedirect),
+ Assert.Throws(() => replicaServer.Execute(0, "HCOLLECT", ["*"], CommandFlags.NoRedirect),
$"Expected exception was not thrown");
- resp = (string)primaryServer.Execute("HCOLLECT", ["*"]);
+ resp = (string)primaryServer.Execute(0, "HCOLLECT", ["*"]);
ClassicAssert.AreEqual("OK", resp);
}
}
diff --git a/test/cluster/Garnet.test.cluster/ClusterNegativeTests.cs b/test/cluster/Garnet.test.cluster/ClusterNegativeTests.cs
index 398738fc8fe..e0033c27c54 100644
--- a/test/cluster/Garnet.test.cluster/ClusterNegativeTests.cs
+++ b/test/cluster/Garnet.test.cluster/ClusterNegativeTests.cs
@@ -616,13 +616,13 @@ public void ClusterReplicateFails()
ClassicAssert.AreNotEqual(primaryEndpoint, replicaEndpoint, "Should have different endpoints for nodes");
- using var primaryConnection = ConnectionMultiplexer.Connect($"{primaryEndpoint.Address}:{primaryEndpoint.Port},user={UserName},password={Password}");
+ using var primaryConnection = ConnectionMultiplexer.Connect($"{primaryEndpoint.Address}:{primaryEndpoint.Port},user={UserName},password={Password},allowAdmin=true");
var primaryServer = primaryConnection.GetServer(primaryEndpoint);
ClassicAssert.AreEqual("OK", (string)primaryServer.Execute("CLUSTER", ["ADDSLOTSRANGE", "0", "16383"], flags: CommandFlags.NoRedirect));
ClassicAssert.AreEqual("OK", (string)primaryServer.Execute("CLUSTER", ["MEET", replicaEndpoint.Address.ToString(), replicaEndpoint.Port.ToString()], flags: CommandFlags.NoRedirect));
- using var replicaConnection = ConnectionMultiplexer.Connect($"{replicaEndpoint.Address}:{replicaEndpoint.Port},user={UserName},password={Password}");
+ using var replicaConnection = ConnectionMultiplexer.Connect($"{replicaEndpoint.Address}:{replicaEndpoint.Port},user={UserName},password={Password},allowAdmin=true");
var replicaServer = replicaConnection.GetServer(replicaEndpoint);
// Try to replicate from a server that doesn't exist
diff --git a/test/cluster/Garnet.test.cluster/ClusterPubSubForwardTests.cs b/test/cluster/Garnet.test.cluster/ClusterPubSubForwardTests.cs
index 357ce1c3bef..2942edbafb4 100644
--- a/test/cluster/Garnet.test.cluster/ClusterPubSubForwardTests.cs
+++ b/test/cluster/Garnet.test.cluster/ClusterPubSubForwardTests.cs
@@ -92,7 +92,7 @@ public void ClusterPublishSurvivesPeerNodeShutdown()
while (baselineDeadline.Elapsed < TimeSpan.FromSeconds(15))
{
Assert.DoesNotThrow(
- () => pubRedis.GetServer(publisherEndpoint).Execute("PUBLISH", channelName, message),
+ () => pubRedis.GetServer(publisherEndpoint).Execute(0, "PUBLISH", [channelName, message]),
"Baseline publish threw while both nodes were up");
if (delivered.Wait(TimeSpan.FromMilliseconds(500)))
{
@@ -133,7 +133,7 @@ public void ClusterPublishSurvivesPeerNodeShutdown()
// (2) Attempt to forward-publish from the surviving node.
try
{
- _ = pubRedis.GetServer(publisherEndpoint).Execute("PUBLISH", channelName, message);
+ _ = pubRedis.GetServer(publisherEndpoint).Execute(0, "PUBLISH", [channelName, message]);
if (sw.Elapsed >= settle)
lateSuccesses++;
}
diff --git a/test/cluster/Garnet.test.cluster/ClusterTestContext.cs b/test/cluster/Garnet.test.cluster/ClusterTestContext.cs
index a8f9bb071ad..6e145252533 100644
--- a/test/cluster/Garnet.test.cluster/ClusterTestContext.cs
+++ b/test/cluster/Garnet.test.cluster/ClusterTestContext.cs
@@ -941,16 +941,16 @@ public string[] ExecuteTxnBulkRead(IServer server, string[] keys)
{
try
{
- var resp = server.Execute("MULTI");
+ var resp = server.Execute(0, "MULTI", []);
ClassicAssert.AreEqual("OK", (string)resp);
foreach (var key in keys)
{
- resp = server.Execute("GET", key);
+ resp = server.Execute(0, "GET", [key]);
ClassicAssert.AreEqual("QUEUED", (string)resp);
}
- resp = server.Execute("EXEC");
+ resp = server.Execute(0, "EXEC", []);
return (string[])resp;
}
catch (Exception ex)
@@ -971,7 +971,7 @@ public static void ExecuteStoredProcBulkIncrement(IServer server, string[] keys,
args[1 + (i * 2)] = keys[i];
args[1 + (i * 2) + 1] = values[i];
}
- var resp = server.Execute("BULKINCRBY", args);
+ var resp = server.Execute(0, "BULKINCRBY", args);
ClassicAssert.AreEqual("OK", (string)resp);
}
catch (Exception ex)
@@ -988,7 +988,7 @@ public static string[] ExecuteBulkReadStoredProc(IServer server, string[] keys)
args[0] = keys.Length;
for (var i = 0; i < keys.Length; i++)
args[1 + i] = keys[i];
- var resp = server.Execute("BULKREAD", args);
+ var resp = server.Execute(0, "BULKREAD", args);
var result = (string[])resp;
ClassicAssert.AreEqual(keys.Length, result.Length);
return result;
diff --git a/test/cluster/Garnet.test.cluster/ClusterTestUtils.cs b/test/cluster/Garnet.test.cluster/ClusterTestUtils.cs
index 4864225d849..06ea1e14812 100644
--- a/test/cluster/Garnet.test.cluster/ClusterTestUtils.cs
+++ b/test/cluster/Garnet.test.cluster/ClusterTestUtils.cs
@@ -181,7 +181,7 @@ public RedisResult Execute(IPEndPoint endPoint, string cmd, ICollection