From: Serge Petrenko <sergepetrenko@tarantool.org> To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 3/8] raft: introduce raft_ev Date: Tue, 15 Dec 2020 13:02:26 +0300 [thread overview] Message-ID: <69a570eb-e594-be09-7761-e3d04772a5f3@tarantool.org> (raw) In-Reply-To: <4dd1ae98a065ac8b348aa2da3edaf28f66724adf.1607879643.git.v.shpilevoy@tarantool.org> 13.12.2020 20:15, Vladislav Shpilevoy пишет: > Raft_ev.h/.c encapsulates usage of libev, to a certain extent. All > libev functions are wrapped into raft_ev_* wrappers. Objects and > types are left intact. > > This is done in order to be able to replace raft_ev.c in the > soon coming unit tests with fakeev functions. That will allow to > simulate time and catch all the raft events with 100% > reproducibility, and without actual waiting for the events in > real time. > > The similar approach is used for swim unit tests. > > Original raft core file is built into a new library 'raft_algo'. > It is done for the sake of code coverage in unit tests. A test > could be built by directly referencing raft.c in > unit/CMakeLists.txt, but it can't apply compilation options to it, > including gcov options. > > When raft.c is built into a library right where it is defined, it > gets the gcov options, and the code covered by unit tests can be > properly shown. > > Part of #5303 Thanks for the patch! LGTM. > --- > src/lib/raft/CMakeLists.txt | 8 +++++ > src/lib/raft/raft.c | 65 +++++++++++++++++++------------------ > src/lib/raft/raft_ev.c | 57 ++++++++++++++++++++++++++++++++ > src/lib/raft/raft_ev.h | 57 ++++++++++++++++++++++++++++++++ > 4 files changed, 156 insertions(+), 31 deletions(-) > create mode 100644 src/lib/raft/raft_ev.c > create mode 100644 src/lib/raft/raft_ev.h > -- Serge Petrenko
next prev parent reply other threads:[~2020-12-15 10:02 UTC|newest] Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-13 17:15 [Tarantool-patches] [PATCH 0/8] Raft module, part 4 - unit tests Vladislav Shpilevoy 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 1/8] fakesys: fix ev_is_active not working on fake timers Vladislav Shpilevoy 2020-12-15 9:42 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 2/8] fakesys: introduce fakeev_timer_remaining() Vladislav Shpilevoy 2020-12-15 9:43 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 3/8] raft: introduce raft_ev Vladislav Shpilevoy 2020-12-15 10:02 ` Serge Petrenko [this message] 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 4/8] test: introduce raft unit tests Vladislav Shpilevoy 2020-12-13 18:10 ` Vladislav Shpilevoy 2020-12-16 13:03 ` Serge Petrenko 2020-12-17 22:44 ` Vladislav Shpilevoy 2020-12-18 8:17 ` Serge Petrenko 2020-12-20 17:28 ` Vladislav Shpilevoy 2020-12-21 7:36 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 5/8] raft: fix crash when received 0 term message Vladislav Shpilevoy 2020-12-16 13:05 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 6/8] raft: fix ignorance of bad state receipt Vladislav Shpilevoy 2020-12-16 13:06 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 7/8] raft: fix crash on election timeout decrease Vladislav Shpilevoy 2020-12-16 13:08 ` Serge Petrenko 2020-12-13 17:15 ` [Tarantool-patches] [PATCH 8/8] raft: fix crash on death " Vladislav Shpilevoy 2020-12-16 13:10 ` Serge Petrenko 2020-12-21 16:50 ` [Tarantool-patches] [PATCH 0/8] Raft module, part 4 - unit tests Vladislav Shpilevoy 2020-12-21 17:29 ` Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=69a570eb-e594-be09-7761-e3d04772a5f3@tarantool.org \ --to=sergepetrenko@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 3/8] raft: introduce raft_ev' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox