testing: let retry's sleeping duration grow faster
[awesomized/libmemcached] / test / tests / memcached / regression / lp_001-048-945.cpp
1 #include "test/lib/common.hpp"
2 #include "test/lib/MemcachedCluster.hpp"
3
4 TEST_CASE("memcached_regression_lp1048945") {
5 MemcachedPtr memc_ptr(memcached_create(nullptr));
6 auto memc = *memc_ptr;
7 LoneReturnMatcher test{memc};
8 memcached_return status;
9
10 auto list = memcached_server_list_append_with_weight(nullptr, "a", 11211, 0, &status);
11 REQUIRE_SUCCESS(status);
12
13 list = memcached_server_list_append_with_weight(list, "b", 11211, 0, &status);
14 REQUIRE_SUCCESS(status);
15
16 list = memcached_server_list_append_with_weight(list, "c", 11211, 0, &status);
17 REQUIRE_SUCCESS(status);
18
19 REQUIRE(3 == memcached_server_list_count(list));
20
21 REQUIRE_SUCCESS(memcached_server_push(memc, list));
22 REQUIRE_SUCCESS(memcached_server_push(memc, list));
23 memcached_server_list_free(list);
24
25 auto server = memcached_server_by_key(memc, S(__func__), &status);
26 REQUIRE(server);
27 REQUIRE_SUCCESS(status);
28 }