mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-05 12:25:51 +00:00
fix: Address AmendmentBlockHandler flakiness in old ETL tests (#2694)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
@@ -36,6 +36,9 @@ struct AmendmentBlockHandlerTest : util::prometheus::WithPrometheus, SyncAsioCon
|
|||||||
etl::SystemState state;
|
etl::SystemState state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Note: This test can be flaky due to the way it was written (depends on time)
|
||||||
|
// Since the old ETL is going to be replaced by ETLng all tests including this one will be deleted anyway so the fix for
|
||||||
|
// flakiness is to increase the context runtime to 50ms until then (to not waste time).
|
||||||
TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
|
TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
|
||||||
{
|
{
|
||||||
AmendmentBlockHandler handler{ctx_, state, std::chrono::nanoseconds{1}, actionMock.AsStdFunction()};
|
AmendmentBlockHandler handler{ctx_, state, std::chrono::nanoseconds{1}, actionMock.AsStdFunction()};
|
||||||
@@ -45,12 +48,7 @@ TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeat
|
|||||||
handler.notifyAmendmentBlocked();
|
handler.notifyAmendmentBlocked();
|
||||||
EXPECT_TRUE(state.isAmendmentBlocked);
|
EXPECT_TRUE(state.isAmendmentBlocked);
|
||||||
|
|
||||||
// Code runs significantly slower when assertions are enabled
|
runContextFor(std::chrono::milliseconds{50});
|
||||||
#ifdef _GLIBCXX_ASSERTIONS
|
|
||||||
runContextFor(std::chrono::milliseconds{10});
|
|
||||||
#else
|
|
||||||
runContextFor(std::chrono::milliseconds{1});
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DefaultAmendmentBlockActionTest : LoggerFixture {};
|
struct DefaultAmendmentBlockActionTest : LoggerFixture {};
|
||||||
|
|||||||
Reference in New Issue
Block a user