fix #76: get returns NOTFOUND on TIMEOUT
[awesomized/libmemcached] / test / tests / memcached / regression / lp_001-540-680.cpp
1 #include "test/lib/common.hpp"
2 #include "test/lib/random.hpp"
3 #include "test/lib/Server.hpp"
4 #include "test/lib/ReturnMatcher.hpp"
5
6 TEST_CASE("memcached_regression_lp1540680") {
7 Server timeout{TESTING_ROOT "/timeout", {"-p", random_port_string}};
8 MemcachedPtr memc;
9 LoneReturnMatcher test{*memc};
10
11 REQUIRE(timeout.start());
12 this_thread::sleep_for(500ms);
13
14 REQUIRE_SUCCESS(memcached_server_add(*memc, "localhost", get<int>(timeout.getSocketOrPort())));
15
16 memcached_return_t rc;
17 Malloced val(memcached_get(*memc, S("not-found"), nullptr, nullptr, &rc));
18 REQUIRE_RC(MEMCACHED_TIMEOUT, rc);
19 REQUIRE_FALSE(*val);
20 }