]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/objectstore/Allocator_bench: clear allocated vec 41828/head
authorKefu Chai <kchai@redhat.com>
Mon, 14 Jun 2021 12:03:11 +0000 (20:03 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 18 Jun 2021 01:13:12 +0000 (09:13 +0800)
otherwise there is chance that test could deallocate the same extents
multiple times.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/objectstore/Allocator_bench.cc

index 526562138a969c09190f580a5fe14e0a252839fd..4977d6a545b7d6a32f4db7f652100c4ccdcf3ba7 100644 (file)
@@ -343,8 +343,10 @@ TEST_P(AllocTest, mempoolAccounting)
     PExtentVector tmp;
     alloc->allocate(alloc_size, alloc_size, 0, 0, &tmp);
     all_allocs[rand()] = tmp;
+    tmp.clear();
     alloc->allocate(alloc_size, alloc_size, 0, 0, &tmp);
     all_allocs[rand()] = tmp;
+    tmp.clear();
 
     auto it = all_allocs.upper_bound(rand());
     if (it != all_allocs.end()) {