etcd-tester: fix "writeTxn" key selection
Found when debugging https://github.com/coreos/etcd/issues/9130. Signed-off-by: Gyuho Lee <gyuhox@gmail.com>release-3.4
parent
52f73c5a6c
commit
6cf220c92a
|
@ -225,7 +225,7 @@ func writeTxn(kvc pb.KVClient, keys []string, txnOps int) stressFunc {
|
||||||
return func(ctx context.Context) (error, int64) {
|
return func(ctx context.Context) (error, int64) {
|
||||||
ks := make(map[string]struct{}, txnOps)
|
ks := make(map[string]struct{}, txnOps)
|
||||||
for len(ks) != txnOps {
|
for len(ks) != txnOps {
|
||||||
ks[keys[rand.Intn(64)]] = struct{}{}
|
ks[keys[rand.Intn(len(keys))]] = struct{}{}
|
||||||
}
|
}
|
||||||
selected := make([]string, 0, txnOps)
|
selected := make([]string, 0, txnOps)
|
||||||
for k := range ks {
|
for k := range ks {
|
||||||
|
|
Loading…
Reference in New Issue