Skip to content

Commit

Permalink
Merge pull request #10815 from jingyih/fix_RLock
Browse files Browse the repository at this point in the history
mvcc/backend: use RLock in test
  • Loading branch information
xiang90 committed Jun 12, 2019
2 parents d6280f9 + b873fbd commit 0de9b8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mvcc/backend/backend_test.go
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0de9b8a

Please sign in to comment.