You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "git-hulk (via GitHub)" <gi...@apache.org> on 2023/08/16 16:41:11 UTC

[GitHub] [kvrocks] git-hulk opened a new pull request, #1680: Fix flaky test failure in TestSlotMigrateSync

git-hulk opened a new pull request, #1680:
URL: https://github.com/apache/kvrocks/pull/1680

   Currently, go-redis will auto-retry if occurs network timeout error, and it may duplicately send the migration command. So we can just ignore this specific error to avoid the flaky failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] torwig commented on pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "torwig (via GitHub)" <gi...@apache.org>.
torwig commented on PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680#issuecomment-1680956975

   @git-hulk I'm not sure if it makes sense to completely disable retries with the following option:
   
   ```
   // Maximum number of retries before giving up.
   // Default is 3 retries; -1 (not 0) disables retries.
   MaxRetries int
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] git-hulk merged pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk merged PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] git-hulk commented on a diff in pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on code in PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680#discussion_r1296191823


##########
tests/gocase/integration/slotmigrate/slotmigrate_test.go:
##########
@@ -473,9 +473,12 @@ func TestSlotMigrateSync(t *testing.T) {
 		validTimeouts := []int{0, 10, 20, 30}
 		for _, timeout := range validTimeouts {
 			slot++
-			result := rdb0.Do(ctx, "clusterx", "migrate", slot, id1, "sync", timeout)
-			require.NoError(t, result.Err(), "with timeout: %v", timeout)
-			require.Equal(t, "OK", result.Val(), "with timeout: %d", timeout)
+			err := rdb0.Do(ctx, "clusterx", "migrate", slot, id1, "sync", timeout).Err()
+			// go-redis will auto-retry if occurs timeout error, so it may return the already migrated slot error,
+			// so we just allow this error here to prevent the flaky test failure.
+			if err != nil && !strings.Contains(err.Error(), "ERR There is already a migrating slot") {
+				require.NoError(t, err)
+			}

Review Comment:
   I'm intent to remove this because the value should be always ok if no error.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] git-hulk commented on pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680#issuecomment-1683402263

   > Make sense to me.
   is there a way we can increase the timeout? it is odd that they timeout on the same instance (machine). In this case, our other commands may also have the possibility of repeated sending.
   
   That's right, we also have the same flaky test in list_test.go which go-redis auto retry may cause LPUSH duplicate elements. Maybe we can increase the timeout and disable retry for all test cases.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] mapleFU commented on a diff in pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on code in PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680#discussion_r1296187344


##########
tests/gocase/integration/slotmigrate/slotmigrate_test.go:
##########
@@ -473,9 +473,12 @@ func TestSlotMigrateSync(t *testing.T) {
 		validTimeouts := []int{0, 10, 20, 30}
 		for _, timeout := range validTimeouts {
 			slot++
-			result := rdb0.Do(ctx, "clusterx", "migrate", slot, id1, "sync", timeout)
-			require.NoError(t, result.Err(), "with timeout: %v", timeout)
-			require.Equal(t, "OK", result.Val(), "with timeout: %d", timeout)
+			err := rdb0.Do(ctx, "clusterx", "migrate", slot, id1, "sync", timeout).Err()
+			// go-redis will auto-retry if occurs timeout error, so it may return the already migrated slot error,
+			// so we just allow this error here to prevent the flaky test failure.
+			if err != nil && !strings.Contains(err.Error(), "ERR There is already a migrating slot") {
+				require.NoError(t, err)
+			}

Review Comment:
   ```suggestion
   			} else {
   			require.Equal(t, "OK", result.Val(), "with timeout: %d", timeout)
   			}
   ```
   
   Would this be better?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kvrocks] git-hulk commented on pull request #1680: Fix flaky test failure in TestSlotMigrateSync

Posted by "git-hulk (via GitHub)" <gi...@apache.org>.
git-hulk commented on PR #1680:
URL: https://github.com/apache/kvrocks/pull/1680#issuecomment-1680960231

   > @git-hulk I'm not sure if it makes sense to completely disable retries with the following option:
   > 
   > ```
   > // Maximum number of retries before giving up.
   > // Default is 3 retries; -1 (not 0) disables retries.
   > MaxRetries int
   > ```
   
   Yes, I also considered this solution, but it'll be failed as well if the timeout happened.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org