X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fmemcached.cc;h=d92944f6bfeb1bd9cec17320229cd880f3edb6f6;hb=85b7bde8fee1a43ace784690188e2f4c62f89825;hp=b8838a06a495bd4bbdf8702daf523e1d1953600d;hpb=2d9bd6ba5e72099ae4c5287ade99300c7f6bd1b7;p=m6w6%2Flibmemcached diff --git a/libtest/memcached.cc b/libtest/memcached.cc index b8838a06..d92944f6 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -97,6 +97,7 @@ public: libtest::Server(host_arg, port_arg, MEMCACHED_BINARY, is_memcached_libtool(), is_socket_arg) { + set_pid_file(); } virtual const char *sasl() const @@ -114,13 +115,27 @@ public: return _username; } - virtual bool has_pid_file() const + bool wait_for_pidfile() const { - return false; + Wait wait(pid(), 4); + + return wait.successful(); } bool ping() { +#if 0 + // Memcached is slow to start, so we need to do this + if (pid_file().empty() == false) + { + if (wait_for_pidfile() == false) + { + Error << "Pidfile was not found:" << pid_file() << " :" << running(); + return -1; + } + } +#endif + memcached_return_t rc; bool ret;