Skip to content

Commit 5872afa

Browse files
committed
try fix grpc timeout test
1 parent ff96568 commit 5872afa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

grpc/tests/timeout_test.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <userver/ugrpc/tests/service_fixtures.hpp>
88

9+
#include <tests/deadline_helpers.hpp>
910
#include <tests/unit_test_client.usrv.pb.hpp>
1011
#include <tests/unit_test_client_qos.hpp>
1112
#include <tests/unit_test_service.usrv.pb.hpp>
@@ -28,7 +29,7 @@ class UnitTestService final : public sample::ugrpc::UnitTestServiceBase {
2829
LOG_DEBUG() << request_counter_ << " request attempt: now=" << std::chrono::system_clock::now()
2930
<< ", deadline=" << context.GetServerContext().deadline();
3031
if (++request_counter_ % 4) {
31-
engine::InterruptibleSleepFor(std::chrono::milliseconds{200});
32+
engine::InterruptibleSleepFor(tests::kShortTimeout + tests::kAddSleep);
3233
EXPECT_TRUE(context.GetServerContext().IsCancelled());
3334
// this status should not reach client because of 'perAttemptRecvTimeout'
3435
LOG_DEBUG() << request_counter_ << ": return ABORTED";
@@ -51,7 +52,7 @@ using TimeoutTest = ugrpc::tests::ServiceFixture<UnitTestService>;
5152
UTEST_F(TimeoutTest, DISABLED_IN_OLD_GRPC_TEST_NAME(PerAttemptTimeout)) {
5253
ugrpc::client::Qos qos;
5354
qos.attempts = 4;
54-
qos.timeout = std::chrono::milliseconds{100};
55+
qos.timeout = tests::kShortTimeout;
5556
ugrpc::client::ClientQos client_qos;
5657
client_qos.SetDefault(qos);
5758
const auto config = std::vector<dynamic_config::KeyValue>{{tests::kUnitTestClientQos, client_qos}};

0 commit comments

Comments
 (0)