Skip to content

Commit

Permalink
Fix test failures for Node client
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Louie <[email protected]>
  • Loading branch information
jonathanl-bq committed Jan 8, 2025
1 parent b75e286 commit 62ec79d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
20 changes: 11 additions & 9 deletions node/tests/GlideClusterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions node/tests/SharedTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1245,21 +1245,21 @@ export function runBaseTests(config: {
"cluster-node-timeout",
])) as Record<string, GlideString>;
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",
"cluster-node-timeout",
])) as Record<string, GlideString>;
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);
Expand Down

0 comments on commit 62ec79d

Please sign in to comment.