Skip to content

Commit

Permalink
Added test with timeouts for creating the client (valkey-io#2868)
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Awawdi <[email protected]>
  • Loading branch information
Muhammad-awawdi-amazon authored Jan 13, 2025
1 parent d31d3fa commit bdaf52a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node/src/GlideClusterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
convertGlideRecordToRecord,
} from "./BaseClient";
import {
ClusterScanOptions,
FlushMode,
FunctionListOptions,
FunctionListResponse,
FunctionRestorePolicy,
FunctionStatsSingleResponse,
InfoOptions,
LolwutOptions,
ClusterScanOptions,
createClientGetName,
createClientId,
createConfigGet,
Expand Down
9 changes: 7 additions & 2 deletions node/tests/GlideClusterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import {
Script,
SlotKeyTypes,
SortOrder,
convertRecordToGlideRecord,
convertGlideRecordToRecord,
convertRecordToGlideRecord,
} from "..";
import { ValkeyCluster } from "../../utils/TestUtils";
import { runBaseTests } from "./SharedTests";
Expand Down Expand Up @@ -2216,8 +2216,10 @@ describe("GlideClusterClient", () => {
getClientConfigurationOption(
azCluster.getAddresses(),
protocol,
{ requestTimeout: 3000 },
),
);

await client_for_config_set.configResetStat();
await client_for_config_set.configSet(
{ "availability-zone": az },
Expand Down Expand Up @@ -2245,6 +2247,7 @@ describe("GlideClusterClient", () => {
azCluster.getAddresses(),
protocol,
{
requestTimeout: 3000,
readFrom: "AZAffinity",
clientAz: az,
},
Expand Down Expand Up @@ -2317,6 +2320,7 @@ describe("GlideClusterClient", () => {
getClientConfigurationOption(
azCluster.getAddresses(),
protocol,
{ requestTimeout: 3000 },
),
);

Expand All @@ -2339,6 +2343,7 @@ describe("GlideClusterClient", () => {
azCluster.getAddresses(),
protocol,
{
requestTimeout: 3000,
readFrom: "AZAffinity",
clientAz: az,
},
Expand Down Expand Up @@ -2408,7 +2413,7 @@ describe("GlideClusterClient", () => {
{
readFrom: "AZAffinity",
clientAz: "non-existing-az",
requestTimeout: 2000,
requestTimeout: 3000,
},
),
);
Expand Down

0 comments on commit bdaf52a

Please sign in to comment.