From: Kefu Chai Date: Mon, 14 Jun 2021 12:03:11 +0000 (+0800) Subject: test/objectstore/Allocator_bench: clear allocated vec X-Git-Tag: v17.1.0~1572^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41828%2Fhead;p=ceph.git test/objectstore/Allocator_bench: clear allocated vec otherwise there is chance that test could deallocate the same extents multiple times. Signed-off-by: Kefu Chai --- diff --git a/src/test/objectstore/Allocator_bench.cc b/src/test/objectstore/Allocator_bench.cc index 526562138a9..4977d6a545b 100644 --- a/src/test/objectstore/Allocator_bench.cc +++ b/src/test/objectstore/Allocator_bench.cc @@ -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()) {