From 62ec79d7fc345884885565be350c0b39ced5426d Mon Sep 17 00:00:00 2001 From: Jonathan Louie Date: Tue, 7 Jan 2025 21:57:25 -0800 Subject: [PATCH] Fix test failures for Node client Signed-off-by: Jonathan Louie --- node/tests/GlideClusterClient.test.ts | 20 +++++++++++--------- node/tests/SharedTests.ts | 6 +++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/node/tests/GlideClusterClient.test.ts b/node/tests/GlideClusterClient.test.ts index ae4768d05f..cee4814035 100644 --- a/node/tests/GlideClusterClient.test.ts +++ b/node/tests/GlideClusterClient.test.ts @@ -326,16 +326,18 @@ describe("GlideClusterClient", () => { if (!cluster.checkIfServerVersionLessThan("7.0.0")) { const transaction = new ClusterTransaction() - .configSet({ timeout: "2000", logfile: "foo" }) - .configGet(["timeout", "logfile"]); + .configSet({ timeout: "2000", "cluster-node-timeout": "16000" }) + .configGet(["timeout", "cluster-node-timeout"]); const result = await client.exec(transaction); - expect(result).toEqual([ - "OK", - convertRecordToGlideRecord({ - timeout: "2000", - logfile: "foo", - }), - ]); + expect(result[0]).toEqual("OK"); + const expectedConfigGetResult = convertRecordToGlideRecord({ + timeout: "2000", + "cluster-node-timeout": "16000", + }); + expect(result[1][0]["key"]).toEqual("cluster-node-timeout"); + expect(result[1][0]["value"]).toEqual("16000"); + expect(result[1][1]["key"]).toEqual("timeout"); + expect(result[1][1]["value"]).toEqual("2000"); } }, TIMEOUT, diff --git a/node/tests/SharedTests.ts b/node/tests/SharedTests.ts index 9ce3fde2c5..e06c329ca7 100644 --- a/node/tests/SharedTests.ts +++ b/node/tests/SharedTests.ts @@ -1245,7 +1245,7 @@ export function runBaseTests(config: { "cluster-node-timeout", ])) as Record; expect( - await client.configSet({ timeout: "1000", cluster-node-timeout: "16000" }), + await client.configSet({ timeout: "1000", "cluster-node-timeout": "16000" }), ).toEqual("OK"); const currParameterValues = (await client.configGet([ "timeout", @@ -1253,13 +1253,13 @@ export function runBaseTests(config: { ])) as Record; expect(currParameterValues).toEqual({ timeout: "1000", - cluster-node-timeout: "16000", + "cluster-node-timeout": "16000", }); /// Revert to the previous configuration expect( await client.configSet({ timeout: prevTimeout["timeout"], - logfile: prevClusterNodeTimeout["cluster-node-timeout"], + "cluster-node-timeout": prevClusterNodeTimeout["cluster-node-timeout"], }), ).toEqual("OK"); }, protocol);