From 6566141841926721ffeb620d29d17cbd3857fdc7 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 2 Nov 2020 20:26:20 +0100 Subject: [PATCH] testing: let retry's sleeping duration grow faster --- test/lib/ForkAndExec.cpp | 1 + test/lib/Retry.cpp | 2 +- test/lib/Retry.hpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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; -- 2.30.2