mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fix test issue in TestScheduleCompaction
It always reuse the same memory space. Each next iteration will always overwrite previous data Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
This commit is contained in:
@@ -76,8 +76,8 @@ func TestScheduleCompaction(t *testing.T) {
|
||||
tx := s.b.BatchTx()
|
||||
|
||||
tx.Lock()
|
||||
ibytes := NewRevBytes()
|
||||
for _, rev := range revs {
|
||||
ibytes := NewRevBytes()
|
||||
ibytes = RevToBytes(rev, ibytes)
|
||||
tx.UnsafePut(schema.Key, ibytes, []byte("bar"))
|
||||
}
|
||||
@@ -90,6 +90,7 @@ func TestScheduleCompaction(t *testing.T) {
|
||||
|
||||
tx.Lock()
|
||||
for _, rev := range tt.wrevs {
|
||||
ibytes := NewRevBytes()
|
||||
ibytes = RevToBytes(rev, ibytes)
|
||||
keys, _ := tx.UnsafeRange(schema.Key, ibytes, nil, 0)
|
||||
if len(keys) != 1 {
|
||||
|
||||
Reference in New Issue
Block a user