From e9b1831478284b6e6226e67aa25e159c3c1358d9 Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Fri, 9 Feb 2024 22:04:08 +0000 Subject: [PATCH 1/4] Refactor testReplMasterCmdProp function in test_repl_master_cmd_prop.go --- internal/test_repl_master_cmd_prop.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/test_repl_master_cmd_prop.go b/internal/test_repl_master_cmd_prop.go index d7702c7d..44710a09 100644 --- a/internal/test_repl_master_cmd_prop.go +++ b/internal/test_repl_master_cmd_prop.go @@ -42,7 +42,6 @@ func testReplMasterCmdProp(stageHarness *testerutils.StageHarness) error { 1: {"foo", "123"}, 2: {"bar", "456"}, 3: {"baz", "789"}, - } for i := 1; i <= len(kvMap); i++ { // We need order of commands preserved key, value := kvMap[i][0], kvMap[i][1] From 1d9a3af4e41b0d6fadfe488b0f92440d1ae712bc Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Fri, 9 Feb 2024 22:06:56 +0000 Subject: [PATCH 2/4] Refactor testReplMasterCmdProp function in test_repl_master_cmd_prop.go --- internal/test_repl_master_cmd_prop.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/test_repl_master_cmd_prop.go b/internal/test_repl_master_cmd_prop.go index 44710a09..21e137d8 100644 --- a/internal/test_repl_master_cmd_prop.go +++ b/internal/test_repl_master_cmd_prop.go @@ -49,7 +49,8 @@ func testReplMasterCmdProp(stageHarness *testerutils.StageHarness) error { client.Send([]string{"SET", key, value}) } - err, _ = readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) + // TODO(Ryan): Find a way to bring this back, and ignore specifically for Redis. + // err, _ = readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) // Redis will send SELECT, but not expected from Users, err is not checked // here. From b9ba4de3b24e6632abc718fcef82b402d2db3474 Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Fri, 9 Feb 2024 22:10:42 +0000 Subject: [PATCH 3/4] Remove SELECT command assertion for Redis replicas in test_repl_multiple_replicas.go and test_repl_wait.go This commit removes the SELECT command assertion for Redis replicas in the test_repl_multiple_replicas.go and test_repl_wait.go files. The SELECT command is not expected from users, so it is unnecessary to check for it. This change is made to improve the test cases for Redis replicas. --- internal/test_repl_multiple_replicas.go | 8 +++++--- internal/test_repl_wait.go | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/test_repl_multiple_replicas.go b/internal/test_repl_multiple_replicas.go index 6a16ae57..f7591c10 100644 --- a/internal/test_repl_multiple_replicas.go +++ b/internal/test_repl_multiple_replicas.go @@ -61,9 +61,11 @@ func testReplMultipleReplicas(stageHarness *testerutils.StageHarness) error { for j := 0; j < 3; j++ { replica := replicas[j] logger.Infof("Testing Replica : %v", j+1) - err, _ = readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) - // Redis will send SELECT, but not expected from Users, err is not checked - // here. + + // TODO(Ryan): Find a way to bring this back, and ignore specifically for Redis. + // err, _ = readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) + // // Redis will send SELECT, but not expected from Users, err is not checked + // // here. for i := 1; i <= len(kvMap); i++ { // We need order of commands preserved diff --git a/internal/test_repl_wait.go b/internal/test_repl_wait.go index 1ae53a79..f5b41a9a 100644 --- a/internal/test_repl_wait.go +++ b/internal/test_repl_wait.go @@ -68,8 +68,9 @@ func testWait(stageHarness *testerutils.StageHarness) error { for i := 0; i < replicaCount; i++ { replica := replicas[i] - err, o := readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) - offset += o + // TODO(Ryan): Find a way to bring this back, and ignore specifically for Redis. + // err, o := readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) + // offset += o err, o = readAndAssertMessages(replica.Reader, []string{"SET", "foo", "123"}, logger) offset += o From 0688f126c90cfd5fbc569b935a197e00be85a92e Mon Sep 17 00:00:00 2001 From: Paul Kuruvilla Date: Fri, 9 Feb 2024 22:34:04 +0000 Subject: [PATCH 4/4] Fix REPL wait test by assigning the error and offset values in the testWait function. --- internal/test_repl_wait.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/test_repl_wait.go b/internal/test_repl_wait.go index f5b41a9a..771c45b2 100644 --- a/internal/test_repl_wait.go +++ b/internal/test_repl_wait.go @@ -72,7 +72,7 @@ func testWait(stageHarness *testerutils.StageHarness) error { // err, o := readAndAssertMessages(replica.Reader, []string{"SELECT", "0"}, logger) // offset += o - err, o = readAndAssertMessages(replica.Reader, []string{"SET", "foo", "123"}, logger) + err, o := readAndAssertMessages(replica.Reader, []string{"SET", "foo", "123"}, logger) offset += o err, o = readAndAssertMessages(replica.Reader, []string{"REPLCONF", "GETACK", "*"}, logger)