mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #10815 from jingyih/fix_RLock
mvcc/backend: use RLock in test
This commit is contained in:
commit
0de9b8abf5
@ -241,9 +241,9 @@ func TestBackendWriteback(t *testing.T) {
|
||||
}
|
||||
rtx := b.ReadTx()
|
||||
for i, tt := range keys {
|
||||
rtx.Lock()
|
||||
rtx.RLock()
|
||||
k, v := rtx.UnsafeRange([]byte("key"), tt.key, tt.end, tt.limit)
|
||||
rtx.Unlock()
|
||||
rtx.RUnlock()
|
||||
if !reflect.DeepEqual(tt.wkey, k) || !reflect.DeepEqual(tt.wval, v) {
|
||||
t.Errorf("#%d: want k=%+v, v=%+v; got k=%+v, v=%+v", i, tt.wkey, tt.wval, k, v)
|
||||
}
|
||||
@ -282,9 +282,9 @@ func TestBackendWritebackForEach(t *testing.T) {
|
||||
return nil
|
||||
}
|
||||
rtx := b.ReadTx()
|
||||
rtx.Lock()
|
||||
rtx.RLock()
|
||||
rtx.UnsafeForEach([]byte("key"), getSeq)
|
||||
rtx.Unlock()
|
||||
rtx.RUnlock()
|
||||
|
||||
partialSeq := seq
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user