Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: Make incremental backup test work #764

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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",
},
Expand All @@ -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 {
Expand Down Expand Up @@ -2515,15 +2515,15 @@ func (oa *operatorActions) CleanWebHookAndServiceOrDie(info *OperatorConfig) {
}

type pumpStatus struct {
StatusMap map[string]*nodeStatus
StatusMap map[string]*nodeStatus `json:"StatusMap"`
}

type nodeStatus struct {
State string `json:"state"`
}

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)
Expand Down Expand Up @@ -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)
Expand All @@ -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) {
Expand Down