|
|
@ -209,7 +209,8 @@ TEST(PreStopHookService, StartDoRequestStop) { |
|
|
|
stub.async()->Hook( |
|
|
|
stub.async()->Hook( |
|
|
|
&infos[1].context, &infos[1].request, &infos[1].response, |
|
|
|
&infos[1].context, &infos[1].request, &infos[1].response, |
|
|
|
[&infos](const Status& status) { infos[1].SetStatus(status); }); |
|
|
|
[&infos](const Status& status) { infos[1].SetStatus(status); }); |
|
|
|
ASSERT_TRUE(service.TestOnlyExpectRequests(2, absl::Milliseconds(100))); |
|
|
|
ASSERT_TRUE(service.TestOnlyExpectRequests( |
|
|
|
|
|
|
|
2, absl::Milliseconds(500) * grpc_test_slowdown_factor())); |
|
|
|
ClientContext ctx; |
|
|
|
ClientContext ctx; |
|
|
|
SetReturnStatusRequest request; |
|
|
|
SetReturnStatusRequest request; |
|
|
|
request.set_grpc_code_to_return(StatusCode::INTERNAL); |
|
|
|
request.set_grpc_code_to_return(StatusCode::INTERNAL); |
|
|
@ -238,7 +239,8 @@ TEST(PreStopHookService, StartDoRequestStop) { |
|
|
|
stub.async()->Hook( |
|
|
|
stub.async()->Hook( |
|
|
|
&call_hangs.context, &call_hangs.request, &call_hangs.response, |
|
|
|
&call_hangs.context, &call_hangs.request, &call_hangs.response, |
|
|
|
[&](const Status& status) { call_hangs.SetStatus(status); }); |
|
|
|
[&](const Status& status) { call_hangs.SetStatus(status); }); |
|
|
|
ASSERT_TRUE(service.TestOnlyExpectRequests(1, absl::Milliseconds(100))); |
|
|
|
ASSERT_TRUE(service.TestOnlyExpectRequests( |
|
|
|
|
|
|
|
1, absl::Milliseconds(500) * grpc_test_slowdown_factor())); |
|
|
|
status = call_hangs.WaitForStatus(absl::Milliseconds(100)); |
|
|
|
status = call_hangs.WaitForStatus(absl::Milliseconds(100)); |
|
|
|
EXPECT_FALSE(status.has_value()) << status->error_message(); |
|
|
|
EXPECT_FALSE(status.has_value()) << status->error_message(); |
|
|
|
service.Stop(); |
|
|
|
service.Stop(); |
|
|
|