summaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/attribute_test.cpp
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-01-05 13:27:40 +0000
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-01-05 13:27:40 +0000
commit8183accd4463a6934e400dfef1005ee89d78957b (patch)
treeee3cba13b758c932ed6968dbd865f4230d82131a /searchlib/src/tests/attribute/attribute_test.cpp
parentcbe2b9f63a29e784e6f46e5d2063c88529796fe2 (diff)
Expose change vector memory usage.
Diffstat (limited to 'searchlib/src/tests/attribute/attribute_test.cpp')
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index 9069c0c2d3e..ce6202f202f 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -1850,11 +1850,13 @@ AttributeTest::testGeneration(const AttributePtr & attr, bool exactStatus)
EXPECT_EQUAL(1u, ia.getCurrentGeneration());
uint64_t lastAllocated;
uint64_t lastOnHold;
+ MemoryUsage changeVectorMemoryUsage(attr->getChangeVectorMemoryUsage());
+ size_t changeVectorAllocated = changeVectorMemoryUsage.allocatedBytes();
if (exactStatus) {
- EXPECT_EQUAL(2u, ia.getStatus().getAllocated());
+ EXPECT_EQUAL(2u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(0u, ia.getStatus().getOnHold());
} else {
- EXPECT_LESS(0u, ia.getStatus().getAllocated());
+ EXPECT_LESS(0u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(0u, ia.getStatus().getOnHold());
lastAllocated = ia.getStatus().getAllocated();
lastOnHold = ia.getStatus().getOnHold();
@@ -1866,7 +1868,7 @@ AttributeTest::testGeneration(const AttributePtr & attr, bool exactStatus)
ia.commit(true);
EXPECT_EQUAL(3u, ia.getCurrentGeneration());
if (exactStatus) {
- EXPECT_EQUAL(6u, ia.getStatus().getAllocated());
+ EXPECT_EQUAL(6u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(2u, ia.getStatus().getOnHold()); // no cleanup due to guard
} else {
EXPECT_LESS(lastAllocated, ia.getStatus().getAllocated());
@@ -1882,7 +1884,7 @@ AttributeTest::testGeneration(const AttributePtr & attr, bool exactStatus)
ia.commit(true);
EXPECT_EQUAL(4u, ia.getCurrentGeneration());
if (exactStatus) {
- EXPECT_EQUAL(4u, ia.getStatus().getAllocated());
+ EXPECT_EQUAL(4u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(0u, ia.getStatus().getOnHold()); // cleanup at end of addDoc()
} else {
EXPECT_GREATER(lastAllocated, ia.getStatus().getAllocated());
@@ -1898,7 +1900,7 @@ AttributeTest::testGeneration(const AttributePtr & attr, bool exactStatus)
ia.commit();
EXPECT_EQUAL(6u, ia.getCurrentGeneration());
if (exactStatus) {
- EXPECT_EQUAL(10u, ia.getStatus().getAllocated());
+ EXPECT_EQUAL(10u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(4u, ia.getStatus().getOnHold()); // no cleanup due to guard
} else {
EXPECT_LESS(lastAllocated, ia.getStatus().getAllocated());
@@ -1910,7 +1912,7 @@ AttributeTest::testGeneration(const AttributePtr & attr, bool exactStatus)
ia.commit(true);
EXPECT_EQUAL(7u, ia.getCurrentGeneration());
if (exactStatus) {
- EXPECT_EQUAL(6u, ia.getStatus().getAllocated());
+ EXPECT_EQUAL(6u + changeVectorAllocated, ia.getStatus().getAllocated());
EXPECT_EQUAL(0u, ia.getStatus().getOnHold()); // cleanup at end of commit()
} else {
EXPECT_GREATER(lastAllocated, ia.getStatus().getAllocated());