Skip to content

Commit

Permalink
Merge a580703 into 52e24c2
Browse files Browse the repository at this point in the history
  • Loading branch information
lucklove authored Apr 5, 2021
2 parents 52e24c2 + a580703 commit 99be167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
6 changes: 2 additions & 4 deletions components/playground/instance/tiflash.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ type scheduleConfig struct {
}

type replicateMaxReplicaConfig struct {
MaxReplicas int `json:"max-replicas"`
EnablePlacementRules string `json:"enable-placement-rules"`
MaxReplicas int `json:"max-replicas"`
}

type replicateEnablePlacementRulesConfig struct {
Expand Down Expand Up @@ -123,8 +122,7 @@ func (inst *TiFlashInstance) Start(ctx context.Context, version utils.Version) e
}
// Update maxReplicas before placement rules so that it would not be overwritten
maxReplicas, err := json.Marshal(replicateMaxReplicaConfig{
MaxReplicas: 1,
EnablePlacementRules: "false",
MaxReplicas: 1,
})
if err != nil {
return err
Expand Down
16 changes: 14 additions & 2 deletions tests/tiup-playground/test_playground.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ function kill_all() {
killall -9 grafana-server || true
killall -9 tiup-playground || true
killall -9 prometheus || true
cat $outfile
}

outfile=/tmp/tiup-playground-test.out
tiup-playground v4.0.10 --tiflash 0 > $outfile 2>&1 &
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

trap "kill_all > /dev/null 2>&1" EXIT
trap "kill_all" EXIT

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)
Expand Down Expand Up @@ -97,4 +98,15 @@ tiup-playground display | grep -E "terminated|exit" | wc -l | grep -q "1"

killall -2 tiup-playground.test || killall -2 tiup-playground

# test restart with same data
tiup-playground nightly > $outfile 2>&1 &

# wait $outfile generated
sleep 3

# wait start cluster successfully
timeout 300 grep -q "CLUSTER START SUCCESSFULLY" <(tail -f $outfile)

cat $outfile | grep ":3930" | grep -q "Done"

echo -e "\033[0;36m<<< Run all test success >>>\033[0m"

0 comments on commit 99be167

Please sign in to comment.