Skip to content

Commit

Permalink
added Sleep(2) after running commands
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Awawdi <[email protected]>
  • Loading branch information
Muhammad-awawdi-amazon committed Dec 19, 2024
1 parent 7533f26 commit 2c94edb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions node/tests/GlideClusterClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,8 @@ describe("GlideClusterClient", () => {
{ route: "allNodes" },
);

await new Promise((resolve) => setTimeout(resolve, 2000));

// Retrieve the number of replicas dynamically
const n_replicas = await getNumberOfReplicas(
client_for_config_set,
Expand Down Expand Up @@ -2146,6 +2148,8 @@ describe("GlideClusterClient", () => {
{ route: "allNodes" },
);

await new Promise((resolve) => setTimeout(resolve, 2000));

if (Array.isArray(azs)) {
const allAZsMatch = azs.every((node) => {
const nodeResponse = node as {
Expand Down Expand Up @@ -2183,6 +2187,8 @@ describe("GlideClusterClient", () => {
await client_for_testing_az.get("foo");
}

await new Promise((resolve) => setTimeout(resolve, 2000));

// Stage 4: Verify GET commands were routed correctly
const info_result =
await client_for_testing_az.customCommand(
Expand Down Expand Up @@ -2265,11 +2271,15 @@ describe("GlideClusterClient", () => {
"RESETSTAT",
]);

await new Promise((resolve) => setTimeout(resolve, 2000));

await client_for_config_set.customCommand(
["CONFIG", "SET", "availability-zone", az],
{ route: { type: "replicaSlotId", id: 12182 } },
);

await new Promise((resolve) => setTimeout(resolve, 2000));

// Stage 2: Create AZ affinity client and verify configuration
client_for_testing_az =
await GlideClusterClient.createClient(
Expand All @@ -2288,6 +2298,8 @@ describe("GlideClusterClient", () => {
await client_for_testing_az.get("foo");
}

await new Promise((resolve) => setTimeout(resolve, 2000));

// Stage 4: Verify GET commands were routed correctly
const info_result =
await client_for_testing_az.customCommand(
Expand Down Expand Up @@ -2377,11 +2389,15 @@ describe("GlideClusterClient", () => {
{ route: "allNodes" },
);

await new Promise((resolve) => setTimeout(resolve, 2000));

// Issue GET commands
for (let i = 0; i < GET_CALLS; i++) {
await client_for_testing_az.get("foo");
}

await new Promise((resolve) => setTimeout(resolve, 2000));

// Fetch command stats from all nodes
const info_result =
await client_for_testing_az.customCommand(
Expand Down

0 comments on commit 2c94edb

Please sign in to comment.