From 18b5d27824b9b7864f673625d8ecf49d257e87fb Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Mon, 10 Jul 2023 17:29:01 +0200 Subject: Handle missed sample of oldest serial. --- searchcore/src/tests/proton/flushengine/flushengine_test.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp index 054d41be89a..6cdf0c478ad 100644 --- a/searchcore/src/tests/proton/flushengine/flushengine_test.cpp +++ b/searchcore/src/tests/proton/flushengine/flushengine_test.cpp @@ -526,7 +526,12 @@ TEST_F("require that oldest serial is found", Fixture(1, IINTERVAL)) EXPECT_TRUE(handler->_done.await(LONG_TIMEOUT)); EXPECT_EQUAL(25ul, handler->_oldestSerial); FlushDoneHistory handlerFlushDoneHistory(handler->getFlushDoneHistory()); - EXPECT_EQUAL(FlushDoneHistory({ 10, 20, 25 }), handlerFlushDoneHistory); + if (handlerFlushDoneHistory.size() == 2u) { + // Lost sample of oldest serial might happen when system load is high + EXPECT_EQUAL(FlushDoneHistory({ 10, 25 }), handlerFlushDoneHistory); + } else { + EXPECT_EQUAL(FlushDoneHistory({ 10, 20, 25 }), handlerFlushDoneHistory); + } } TEST_F("require that GC targets are not considered when oldest serial is found", Fixture(1, IINTERVAL)) -- cgit v1.2.3