fix: Flaky DeadlineIsHandledCorrectly (#2716)

This commit is contained in:
Alex Kremer
2025-10-23 16:33:58 +01:00
committed by GitHub
parent d0ec60381b
commit f41d574204

View File

@@ -374,8 +374,10 @@ TEST_F(GrpcSourceNgTests, DeadlineIsHandledCorrectly)
auto grpcSource =
std::make_unique<etlng::impl::GrpcSource>("localhost", std::to_string(getXRPLMockPort()), kDEADLINE);
// Note: this may not be called at all if gRPC cancels before it gets a chance to call the stub
EXPECT_CALL(mockXrpLedgerAPIService, GetLedger)
.WillOnce([&](grpc::ServerContext*,
.Times(testing::AtMost(1))
.WillRepeatedly([&](grpc::ServerContext*,
org::xrpl::rpc::v1::GetLedgerRequest const*,
org::xrpl::rpc::v1::GetLedgerResponse*) {
// wait for main thread to discard us and fail the test if unsuccessful within expected timeframe