From: Michael Wallner Date: Mon, 2 Nov 2020 19:26:20 +0000 (+0100) Subject: testing: let retry's sleeping duration grow faster X-Git-Tag: 1.1.0-beta1~129 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6566141841926721ffeb620d29d17cbd3857fdc7;p=awesomized%2Flibmemcached testing: let retry's sleeping duration grow faster --- diff --git a/test/lib/ForkAndExec.cpp b/test/lib/ForkAndExec.cpp index ac30dd02..5af789f6 100644 --- a/test/lib/ForkAndExec.cpp +++ b/test/lib/ForkAndExec.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #if !HAVE_PIPE2 static inline int setfl(int fd, int newflags) { diff --git a/test/lib/Retry.cpp b/test/lib/Retry.cpp index d8061e31..5764091f 100644 --- a/test/lib/Retry.cpp +++ b/test/lib/Retry.cpp @@ -15,7 +15,7 @@ bool Retry::operator()() { return true; } this_thread::sleep_for(dur); - dur += dur/10; + dur += dur / growth; } return false; diff --git a/test/lib/Retry.hpp b/test/lib/Retry.hpp index dba843ba..65cbeb5e 100644 --- a/test/lib/Retry.hpp +++ b/test/lib/Retry.hpp @@ -26,6 +26,7 @@ public: bool operator()(); private: + const unsigned growth = 3; unsigned max; chrono::milliseconds sleep_for; predicate pred;