[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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.