Skip to content

Commit

Permalink
functional/tester: prevent embedded etcd running with failpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Apr 23, 2018
1 parent 4f45f5d commit c8d08a8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions functional/tester/cluster_read_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,18 @@ func read(lg *zap.Logger, fpath string) (*Cluster, error) {
return nil, fmt.Errorf("len(clus.Members) expects at least 3, got %d", len(clus.Members))
}

failpointsEnabled := false
for _, c := range clus.Tester.Cases {
if c == rpcpb.Case_FAILPOINTS.String() {
failpointsEnabled = true
break
}
}

for i, mem := range clus.Members {
if mem.EtcdExec == "embed" && failpointsEnabled {
return nil, errors.New("EtcdExec 'embed' cannot be run with failpoints enabled")
}
if mem.BaseDir == "" {
return nil, fmt.Errorf("BaseDir cannot be empty (got %q)", mem.BaseDir)
}
Expand Down

0 comments on commit c8d08a8

Please sign in to comment.