diff --git a/pkg/utils/apiutil/serverapi/middleware.go b/pkg/utils/apiutil/serverapi/middleware.go index 335680d7da0..f257efb34f9 100644 --- a/pkg/utils/apiutil/serverapi/middleware.go +++ b/pkg/utils/apiutil/serverapi/middleware.go @@ -151,8 +151,8 @@ func (h *redirector) matchMicroServiceRedirectRules(r *http.Request) (bool, stri } else { r.URL.Path = rule.targetPath } - log.Info("redirect to micro service", zap.String("path", r.URL.Path), zap.String("origin-path", origin), - zap.String("target", addr), zap.String("method", r.Method), zap.Any("query", r.URL.Query())) + log.Debug("redirect to micro service", zap.String("path", r.URL.Path), zap.String("origin-path", origin), + zap.String("target", addr), zap.String("method", r.Method)) return true, addr } } diff --git a/tests/pdctl/scheduler/scheduler_test.go b/tests/pdctl/scheduler/scheduler_test.go index 7098637c84a..56d7b1cd078 100644 --- a/tests/pdctl/scheduler/scheduler_test.go +++ b/tests/pdctl/scheduler/scheduler_test.go @@ -646,18 +646,20 @@ func TestForwardSchedulerRequest(t *testing.T) { server := cluster.GetLeaderServer() re.NoError(server.BootstrapCluster()) backendEndpoints := server.GetAddr() - tc, err := tests.NewTestSchedulingCluster(ctx, 2, backendEndpoints) + tc, err := tests.NewTestSchedulingCluster(ctx, 1, backendEndpoints) re.NoError(err) defer tc.Destroy() tc.WaitForPrimaryServing(re) cmd := pdctlCmd.GetRootCmd() args := []string{"-u", backendEndpoints, "scheduler", "show"} - var slice []string - output, err := pdctl.ExecuteCommand(cmd, args...) - re.NoError(err) - re.NoError(json.Unmarshal(output, &slice)) - re.Contains(slice, "balance-leader-scheduler") + var sches []string + testutil.Eventually(re, func() bool { + output, err := pdctl.ExecuteCommand(cmd, args...) + re.NoError(err) + re.NoError(json.Unmarshal(output, &sches)) + return slice.Contains(sches, "balance-leader-scheduler") + }) mustUsage := func(args []string) { output, err := pdctl.ExecuteCommand(cmd, args...) diff --git a/tests/server/api/rule_test.go b/tests/server/api/rule_test.go index ffdf56b6567..ac52362df4e 100644 --- a/tests/server/api/rule_test.go +++ b/tests/server/api/rule_test.go @@ -565,8 +565,10 @@ func (suite *ruleTestSuite) checkGetAllByKey(cluster *tests.TestCluster) { var resp []*placement.Rule url := fmt.Sprintf("%s/rules/key/%s", urlPrefix, testCase.key) if testCase.success { - err = tu.ReadGetJSON(re, testDialClient, url, &resp) - suite.Len(resp, testCase.respSize) + tu.Eventually(re, func() bool { + err = tu.ReadGetJSON(re, testDialClient, url, &resp) + return len(resp) == testCase.respSize + }) } else { err = tu.CheckGetJSON(testDialClient, url, nil, tu.Status(re, testCase.code)) }