[tarantool-patches] Re: [PATCH 2/6] test: introduce breakpoints for swim's event loop

Konstantin Osipov kostja at tarantool.org
Fri Mar 29 21:20:27 MSK 2019


* Vladislav Shpilevoy <v.shpilevoy at tarantool.org> [19/03/20 14:11]:
> Breakpoint as API gives a test writer more control over timing of
> condition checks. Breakpoint stops the swim's event loop in a
> certain moment of virtual time.
> 
> Without breakpoints it is possible, that a condition has failed
> its deadline, but it can not be checked properly. For example,
> assume that there is a cluster of two members, and after 1 second
> they should become fullmesh. It means, that any checks in [0, 1)
> time have to fail. But without breakpoints it is not so:

>From the description of the event, I would actually expect it to 
stop the event loop, while you're stopping the event loop from the
helper macro. Why is it a macro btw? Why not make it a function?

Anyway, from this description I would expect that
swim_brk_event_process does something like ev_loop_break(), and
then the loop has to be resumed. It's fully up to you to do it
differently, but please fix the docs so that there is no
ambiguity. And, once again, does swim_wait_timeout have to be a
macro?

As a final nit, I would prefix all testing APIs with a name that 
would make sure they are never confused with the actual SWIM API.

E.g. swim_wait_timeout() could be easily confused with some public
method by a newbie. Perhaps choose an entirely different prefix
for the testing harness methods like swim_unit_* swim_ut_ or swum?
> 

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list