mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 11:55:51 +00:00 
			
		
		
		
	fix: ASAN issue with AmendmentBlockHandler test (#2674)
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
This commit is contained in:
		@@ -25,4 +25,5 @@
 | 
			
		||||
 | 
			
		||||
struct MockAmendmentBlockHandler : etlng::AmendmentBlockHandlerInterface {
 | 
			
		||||
    MOCK_METHOD(void, notifyAmendmentBlocked, (), (override));
 | 
			
		||||
    MOCK_METHOD(void, stop, (), (override));
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@ struct AmendmentBlockHandlerTest : util::prometheus::WithPrometheus, SyncAsioCon
 | 
			
		||||
    etl::SystemState state;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
TEST_F(AmendmentBlockHandlerTest, CallTonotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
 | 
			
		||||
TEST_F(AmendmentBlockHandlerTest, CallToNotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
 | 
			
		||||
{
 | 
			
		||||
    AmendmentBlockHandler handler{ctx_, state, std::chrono::nanoseconds{1}, actionMock.AsStdFunction()};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ protected:
 | 
			
		||||
    util::async::CoroExecutionContext ctx_;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
TEST_F(AmendmentBlockHandlerNgTests, CallTonotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
 | 
			
		||||
TEST_F(AmendmentBlockHandlerNgTests, CallToNotifyAmendmentBlockedSetsStateAndRepeatedlyCallsAction)
 | 
			
		||||
{
 | 
			
		||||
    static constexpr auto kMAX_ITERATIONS = 10uz;
 | 
			
		||||
    etlng::impl::AmendmentBlockHandler handler{ctx_, state_, std::chrono::nanoseconds{1}, actionMock_.AsStdFunction()};
 | 
			
		||||
@@ -55,6 +55,7 @@ TEST_F(AmendmentBlockHandlerNgTests, CallTonotifyAmendmentBlockedSetsStateAndRep
 | 
			
		||||
 | 
			
		||||
    handler.notifyAmendmentBlocked();
 | 
			
		||||
    stop.acquire();  // wait for the counter to reach over kMAX_ITERATIONS
 | 
			
		||||
    handler.stop();
 | 
			
		||||
 | 
			
		||||
    EXPECT_TRUE(state_.isAmendmentBlocked);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user