summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-05-15 20:59:32 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-05-15 20:59:32 +0000
commit16ca9ab02d7a719e2f3eb2a9d8f3a0cfc37d984e (patch)
tree3a74ed641edc8dffaab18f29171e247d63d5f14e /searchcore
parent0d21043fd9b6f1182daf53a4ff0464cba7daa92d (diff)
To avoid an inherent race in testing flush versus prune instead test for what should certainly not be present, and for
a smaller subset of what will normally be present in the prune history.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/proton/flushengine/flushengine_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
index 4033fe679ca..054d41be89a 100644
--- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
+++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp
@@ -548,7 +548,11 @@ TEST_F("require that GC targets are not considered when oldest serial is found",
// Before anything is flushed the oldest serial is 5.
// After 'foo' has been flushed the oldest serial is 20 as GC target 'bar' is not considered.
- EXPECT_EQUAL(FlushDoneHistory({ 5, 20, 20, 25 }), handler->getFlushDoneHistory());
+ FlushDoneHistory history = handler->getFlushDoneHistory();
+ EXPECT_TRUE(history.end() == std::find(history.begin(), history.end(), 10));
+ auto last_unique = std::unique(history.begin(), history.end());
+ history.erase(last_unique, history.end());
+ EXPECT_EQUAL(FlushDoneHistory({ 5, 20, 25 }), history);
}
TEST_F("require that oldest serial is found in group", Fixture(2, IINTERVAL))