X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libtest%2Fserver.cc;h=41da231cf1ef3c25c73beb4919f8a05a2219bcf7;hb=7933fa8f9217d7e744876773a4033b3cda4c3c16;hp=6ff6fc3a3a24a50a3377f8640d9d332783de529c;hpb=3dcd41c50068eec906a1a11a178e9b3f08ef2326;p=m6w6%2Flibmemcached diff --git a/libtest/server.cc b/libtest/server.cc index 6ff6fc3a..41da231c 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -201,21 +201,22 @@ bool Server::start() { if (_app.check()) { + _app.slurp(); continue; } char buf[PATH_MAX]; - getcwd(buf, sizeof(buf)); + char *getcwd_buf= getcwd(buf, sizeof(buf)); throw libtest::fatal(LIBYATL_DEFAULT_PARAM, "Unable to open pidfile in %s for: %s stderr:%s", - buf, + getcwd_buf ? getcwd_buf : "", _running.c_str(), _app.stderr_c_str()); } } } - uint32_t this_wait; + uint32_t this_wait= 0; bool pinged= false; { uint32_t timeout= 20; // This number should be high enough for valgrind startup (which is slow) @@ -247,20 +248,26 @@ bool Server::start() if (kill_file(pid_file()) == false) { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to kill off server after startup occurred, when pinging failed: %s stderr:%s", + "Failed to kill off server, waited: %u after startup occurred, when pinging failed: %s stderr:%s", + this_wait, pid_file().c_str(), _app.stderr_c_str()); } throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to ping(), waited: %u server started, having pid_file. exec: %s stderr:%s", + "Failed native ping(), pid: %d is alive: %s waited: %u server started, having pid_file. exec: %s stderr:%s", + int(_app.pid()), + _app.check() ? "true" : "false", this_wait, _running.c_str(), _app.stderr_c_str()); } else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, - "Failed to ping() server started. exec: %s stderr:%s", + "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %s stderr:%s", + int(_app.pid()), + _app.check() ? "true" : "false", + this_wait, _running.c_str(), _app.stderr_c_str()); } @@ -369,7 +376,7 @@ bool Server::args(Application& app) { // Set a log file if it was requested (and we can) - if (false and has_log_file_option()) + if (has_log_file_option()) { set_log_file(); log_file_option(app, _log_file);