From 88ce8198d12757950107694ffbc50a9a9fc40727 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 14 Jun 2021 20:03:11 +0800 Subject: [PATCH] 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 --- src/test/objectstore/Allocator_bench.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/objectstore/Allocator_bench.cc b/src/test/objectstore/Allocator_bench.cc index 526562138a969..4977d6a545b7d 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()) { -- 2.39.5