From fd66e60622e8e139753f62454cfdd5be662e39a0 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 27 Oct 2020 18:39:03 +0100 Subject: [PATCH] testing: freebsd [travis skip] --- .cirrus.yml | 1 + test/lib/Cluster.cpp | 10 +++++++--- test/lib/Cluster.hpp | 2 +- test/tests/memcached/errors.cpp | 6 +++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index bb175484..c20d4a4e 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -44,6 +44,7 @@ task: build_script: | sudo -E -u nobody make -C build -j2 all test_script: | + sysctl net.inet.tcp.msl=500 sudo -E -u nobody make -C build -j2 test/fast install_script: | sudo -E -u nobody make -C build install DESTDIR=/tmp diff --git a/test/lib/Cluster.cpp b/test/lib/Cluster.cpp index 4fcdb47b..54de9398 100644 --- a/test/lib/Cluster.cpp +++ b/test/lib/Cluster.cpp @@ -46,11 +46,15 @@ bool Cluster::start() { return started; } -void Cluster::stop() { +void Cluster::stop(bool graceful) { for (auto &server : cluster) { server.drain(); - // no cookies for memcached; TERM is just too slow - server.signal(SIGKILL); + if (graceful) { + server.stop(); + } else { + // no cookies for memcached; TERM is just too slow + server.signal(SIGKILL); + } } } diff --git a/test/lib/Cluster.hpp b/test/lib/Cluster.hpp index c99e1d37..4e151020 100644 --- a/test/lib/Cluster.hpp +++ b/test/lib/Cluster.hpp @@ -42,7 +42,7 @@ public: const vector &getServers() const; bool start(); - void stop(); + void stop(bool graceful = false); bool isStopped(); bool isListening(); void wait(); diff --git a/test/tests/memcached/errors.cpp b/test/tests/memcached/errors.cpp index 4b3b4684..c143b27f 100644 --- a/test/tests/memcached/errors.cpp +++ b/test/tests/memcached/errors.cpp @@ -23,7 +23,11 @@ TEST_CASE("memcached_errors") { REQUIRE_SUCCESS(memcached_set(memc, S("foo"), nullptr, 0, 0, 0)); memcached_quit(memc); - test.cluster.stop(); + test.cluster.stop( +#if __FreeBSD__ + true // graceful +#endif + ); Retry cluster_is_stopped{[&cluster = test.cluster]{ return cluster.isStopped(); }}; -- 2.30.2