Merge pull request #9133 from gyuho/tester-fix

etcd-tester: fix "writeTxn" key selection
This commit is contained in:
Gyuho Lee
2018-01-11 11:16:42 -08:00
committed by GitHub

View File

@@ -225,7 +225,7 @@ func writeTxn(kvc pb.KVClient, keys []string, txnOps int) stressFunc {
return func(ctx context.Context) (error, int64) {
ks := make(map[string]struct{}, txnOps)
for len(ks) != txnOps {
ks[keys[rand.Intn(64)]] = struct{}{}
ks[keys[rand.Intn(len(keys))]] = struct{}{}
}
selected := make([]string, 0, txnOps)
for k := range ks {