Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc timeout test #873

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions grpc/tests/timeout_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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

#include <tests/deadline_helpers.hpp>
#include <tests/unit_test_client.usrv.pb.hpp>
#include <tests/unit_test_client_qos.hpp>
#include <tests/unit_test_service.usrv.pb.hpp>
Expand All @@ -28,7 +29,7 @@ class UnitTestService final : public sample::ugrpc::UnitTestServiceBase {
LOG_DEBUG() << request_counter_ << " request attempt: now=" << std::chrono::system_clock::now()
<< ", deadline=" << context.GetServerContext().deadline();
if (++request_counter_ % 4) {
engine::InterruptibleSleepFor(std::chrono::milliseconds{200});
engine::InterruptibleSleepFor(tests::kShortTimeout + tests::kAddSleep);
EXPECT_TRUE(context.GetServerContext().IsCancelled());
// this status should not reach client because of 'perAttemptRecvTimeout'
LOG_DEBUG() << request_counter_ << ": return ABORTED";
Expand All @@ -51,7 +52,7 @@ using TimeoutTest = ugrpc::tests::ServiceFixture<UnitTestService>;
UTEST_F(TimeoutTest, DISABLED_IN_OLD_GRPC_TEST_NAME(PerAttemptTimeout)) {
ugrpc::client::Qos qos;
qos.attempts = 4;
qos.timeout = std::chrono::milliseconds{100};
qos.timeout = tests::kShortTimeout;
ugrpc::client::ClientQos client_qos;
client_qos.SetDefault(qos);
const auto config = std::vector<dynamic_config::KeyValue>{{tests::kUnitTestClientQos, client_qos}};
Expand Down
Loading