From c3472bb8e7417a272f8c76c5a1316e3370adc941 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 13 Jan 2020 16:29:08 +0100 Subject: [PATCH] tests: fix flaky regression_bug_1251482 test --- tests/libmemcached-1.0/mem_functions.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index 0d6d047d..0e380b7a 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -4848,7 +4848,7 @@ test_return_t regression_bug_1251482(memcached_st*) memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, 0); - for (size_t x= 4; x; --x) + for (size_t x= 0; x < 5; ++x) { size_t value_length; memcached_return_t rc; @@ -4858,7 +4858,11 @@ test_return_t regression_bug_1251482(memcached_st*) test_false(value); test_compare(0LLU, value_length); - test_compare(MEMCACHED_CONNECTION_FAILURE, rc); + if (x) { + test_ne_compare(MEMCACHED_SUCCESS, rc); + } else { + test_compare(MEMCACHED_CONNECTION_FAILURE, rc); + } } return TEST_SUCCESS; -- 2.30.2