[core/c++] Mocking timer for unit tests involving gRPC async calls.

28 views
Skip to first unread message

chh...@mesosphere.io

unread,
Mar 16, 2018, 3:04:31 AM3/16/18
to grpc.io
Hi all,

I'm writing unit tests that use gRPC client stub to make asynchronous calls with deadlines.
I was wondering if there is a way to manipulate the timer in gRPC to make the call timed out
faster in my unit tests. Any idea about this, either using the C++ wrapper or the core library?

Thanks,
Chun-Hung

Yang Gao

unread,
Apr 9, 2018, 4:54:34 PM4/9/18
to grpc.io
I am afraid there is no easy way to do this now.

In some tests we explicitly override the definition of "now". This might be able to achieve what you want, but usually it is used for something lower level.

See bdp_estimator_test.cc for an example.
Reply all
Reply to author
Forward
0 new messages