diff --git a/osquery/remote/tests/test_utils.cpp b/osquery/remote/tests/test_utils.cpp index fa04818791f..4be1850b498 100644 --- a/osquery/remote/tests/test_utils.cpp +++ b/osquery/remote/tests/test_utils.cpp @@ -162,16 +162,15 @@ bool TLSServerRunner::start(const std::string& server_cert, // Verify that the server is also actually ready to serve retry = 0; bool ready_to_serve = false; - setClientConfig(); while (retry < max_retry) { std::string ping_server_uri = "https://localhost:" + std::string(self.port_); Request request(ping_server_uri); Status status = request.call(); - if (!status.ok()) { - LOG(WARNING) << "Python HTTP Server not ready yet: " - << status.getMessage(); + if (!status.ok() && + status.getMessage().find("timeout") != std::string::npos) { + LOG(WARNING) << "Python HTTP Server not ready yet"; sleepFor(1000); ++retry; continue; @@ -180,7 +179,6 @@ bool TLSServerRunner::start(const std::string& server_cert, ready_to_serve = true; break; } - unsetClientConfig(); if (!ready_to_serve) { LOG(ERROR) << "The Python server was not ready to serve in time"; diff --git a/osquery/remote/transports/tests/tls_transports_tests.cpp b/osquery/remote/transports/tests/tls_transports_tests.cpp index 087a2aee96c..c54493d59bb 100644 --- a/osquery/remote/transports/tests/tls_transports_tests.cpp +++ b/osquery/remote/transports/tests/tls_transports_tests.cpp @@ -59,10 +59,11 @@ class TLSTransportsTests : public testing::Test { void startServer(const std::string& server_cert = {}, bool verify_client_cert = false) { - certs_ = FLAGS_tls_server_certs; - FLAGS_tls_server_certs = ""; ASSERT_TRUE(TLSServerRunner::start(server_cert, verify_client_cert)); port_ = TLSServerRunner::port(); + + certs_ = FLAGS_tls_server_certs; + FLAGS_tls_server_certs = ""; } void TearDown() override {