diff --git a/tests/actions.go b/tests/actions.go index 334184e0ba2..3db04fcd15e 100644 --- a/tests/actions.go +++ b/tests/actions.go @@ -2354,7 +2354,7 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD for _, pod := range pods.Items { if !oa.pumpHealth(info, pod.Spec.Hostname) { glog.Errorf("some pods is not health %s", pumpStatefulSetName) - // return false, nil + return false, nil } if isv1 { @@ -2396,7 +2396,7 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD listOps = metav1.ListOptions{ LabelSelector: labels.SelectorFromSet( map[string]string{ - label.ComponentLabelKey: "pump", + label.ComponentLabelKey: "drainer", label.InstanceLabelKey: drainerStatefulSet.Labels[label.InstanceLabelKey], label.NameLabelKey: "tidb-cluster", }, @@ -2410,7 +2410,7 @@ func (oa *operatorActions) CheckIncrementalBackup(info *TidbClusterConfig, withD for _, pod := range pods.Items { if !oa.drainerHealth(info, pod.Spec.Hostname) { glog.Errorf("some pods is not health %s", drainerStatefulSetName) - // return false, nil + return false, nil } if isv1 { @@ -2515,7 +2515,7 @@ func (oa *operatorActions) CleanWebHookAndServiceOrDie(info *OperatorConfig) { } type pumpStatus struct { - StatusMap map[string]*nodeStatus + StatusMap map[string]*nodeStatus `json:"StatusMap"` } type nodeStatus struct { @@ -2523,7 +2523,7 @@ type nodeStatus struct { } func (oa *operatorActions) pumpHealth(info *TidbClusterConfig, hostName string) bool { - pumpHealthURL := fmt.Sprintf("%s.%s-pump.%s:8250/status", hostName, info.ClusterName, info.Namespace) + pumpHealthURL := fmt.Sprintf("http://%s.%s-pump.%s:8250/status", hostName, info.ClusterName, info.Namespace) res, err := http.Get(pumpHealthURL) if err != nil { glog.Errorf("cluster:[%s] call %s failed,error:%v", info.ClusterName, pumpHealthURL, err) @@ -2561,7 +2561,7 @@ type drainerStatus struct { } func (oa *operatorActions) drainerHealth(info *TidbClusterConfig, hostName string) bool { - drainerHealthURL := fmt.Sprintf("%s.%s-drainer.%s:8249/status", hostName, info.ClusterName, info.Namespace) + drainerHealthURL := fmt.Sprintf("http://%s.%s-drainer.%s:8249/status", hostName, info.ClusterName, info.Namespace) res, err := http.Get(drainerHealthURL) if err != nil { glog.Errorf("cluster:[%s] call %s failed,error:%v", info.ClusterName, drainerHealthURL, err) @@ -2582,7 +2582,7 @@ func (oa *operatorActions) drainerHealth(info *TidbClusterConfig, hostName strin glog.Errorf("cluster:[%s] unmarshal failed,error:%v", info.ClusterName, err) return false } - return len(healths.PumpPos) > 0 && healths.Synced + return len(healths.PumpPos) > 0 } func (oa *operatorActions) EmitEvent(info *TidbClusterConfig, message string) {