From: Michael Wallner Date: Tue, 10 Nov 2020 15:31:12 +0000 (+0100) Subject: testing: retry check for memcp X-Git-Tag: 1.1.0-beta1~114 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6d4d18e81d6c99a2608fe8acc2b0d7acdb26c615;p=awesomized%2Flibmemcached testing: retry check for memcp --- diff --git a/test/tests/bin/memcp.cpp b/test/tests/bin/memcp.cpp index cdd85e59..9a307128 100644 --- a/test/tests/bin/memcp.cpp +++ b/test/tests/bin/memcp.cpp @@ -77,18 +77,14 @@ TEST_CASE("bin/memcp") { REQUIRE(output == ""); REQUIRE(ok); - if (udp_buffer == 1) { - memcached_quit(*memc); - this_thread::sleep_for(500ms); - } - - size_t len; - memcached_return_t rc; - Malloced val(memcached_get(*memc, S(temp.getFn()), &len, nullptr, &rc)); - - REQUIRE(*val); - REQUIRE_SUCCESS(rc); - REQUIRE(string(*val, len) == "123"); + Retry settled{[&memc, &temp]{ + size_t len; + memcached_return_t rc; + Malloced val(memcached_get(*memc, S(temp.getFn()), &len, nullptr, &rc)); + + return MEMCACHED_SUCCESS == rc && *val && string(*val, len) == "123"; + }}; + REQUIRE(settled()); } }