From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B2AA1274A5 for ; Fri, 29 Mar 2019 14:20:29 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KPV6MdhKtOz5 for ; Fri, 29 Mar 2019 14:20:29 -0400 (EDT) Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 6769123E5F for ; Fri, 29 Mar 2019 14:20:29 -0400 (EDT) Received: from [185.6.245.178] (port=34378 helo=atlas.local) by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1h9w79-00037H-Pq for tarantool-patches@freelists.org; Fri, 29 Mar 2019 21:20:27 +0300 Date: Fri, 29 Mar 2019 21:20:27 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 2/6] test: introduce breakpoints for swim's event loop Message-ID: <20190329182027.GA20712@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladislav Shpilevoy [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