mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests/robustness: Fix multi txn key prefix
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
This commit is contained in:
parent
04d24c2128
commit
0d2d383f0a
@ -277,7 +277,7 @@ func (c etcdTrafficClient) pickMultiTxnOps() (ops []clientv3.Op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i, opType := range opTypes {
|
for i, opType := range opTypes {
|
||||||
key := fmt.Sprintf("%d", keys[i])
|
key := c.key(keys[i])
|
||||||
switch opType {
|
switch opType {
|
||||||
case model.RangeOperation:
|
case model.RangeOperation:
|
||||||
ops = append(ops, clientv3.OpGet(key))
|
ops = append(ops, clientv3.OpGet(key))
|
||||||
@ -294,7 +294,11 @@ func (c etcdTrafficClient) pickMultiTxnOps() (ops []clientv3.Op) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c etcdTrafficClient) randomKey() string {
|
func (c etcdTrafficClient) randomKey() string {
|
||||||
return fmt.Sprintf("%s%d", c.keyPrefix, rand.Int()%c.keyCount)
|
return c.key(rand.Int())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c etcdTrafficClient) key(i int) string {
|
||||||
|
return fmt.Sprintf("%s%d", c.keyPrefix, i%c.keyCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t etcdTraffic) pickOperationType() model.OperationType {
|
func (t etcdTraffic) pickOperationType() model.OperationType {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user