diff options
author | Tor Egge <Tor.Egge@online.no> | 2023-01-17 11:39:09 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2023-01-17 11:39:09 +0100 |
commit | 8a290cc224f76d6cc8625c8350fe8d0b35586a5c (patch) | |
tree | 7fa0902f7dce78212fb0dc3e8cdf2370c9ceb03c /searchlib/src/tests | |
parent | fd0f732c68d287290bb8fa811c0bc5906ed2029f (diff) |
Test Hnsw nodeid allocation after load.
Diffstat (limited to 'searchlib/src/tests')
-rw-r--r-- | searchlib/src/tests/tensor/hnsw_nodeid_mapping/hnsw_nodeid_mapping_test.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_nodeid_mapping/hnsw_nodeid_mapping_test.cpp b/searchlib/src/tests/tensor/hnsw_nodeid_mapping/hnsw_nodeid_mapping_test.cpp index bc1417e325a..032ca96178b 100644 --- a/searchlib/src/tests/tensor/hnsw_nodeid_mapping/hnsw_nodeid_mapping_test.cpp +++ b/searchlib/src/tests/tensor/hnsw_nodeid_mapping/hnsw_nodeid_mapping_test.cpp @@ -112,10 +112,11 @@ TEST_F(HnswNodeidMappingTest, on_load_populates_mapping) nodes[7].levels_ref().store_relaxed(EntryRef(3)); nodes[7].store_docid(4); nodes[7].store_subspace(1); - mapping.on_load(vespalib::ConstArrayRef(nodes.data(), nodes.size())); + mapping.on_load(vespalib::ConstArrayRef(nodes.data(), 9)); expect_get({1}, 7); expect_get({2, 7}, 4); - expect_allocate_get({3, 4, 5, 6, 8, 9}, 1); + // Drain free list when allocating nodeids. + expect_allocate_get({3, 4, 5, 6, 8, 9, 10}, 1); } TEST_F(HnswNodeidMappingTest, memory_usage_increases_when_allocating_nodeids) |