test/httpwserror.cpp |    6 +++---
 test/httpwstest.cpp  |    2 +-
 wsd/LOOLWSD.cpp      |    3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit bb12de8035e8d34c03eff83991034237e7ff7ee1
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Thu Apr 6 21:50:29 2017 -0400

    wsd: lower the max number of test docs and connections
    
    Tests should have sensible limits so they don't
    go overboard and fail needlessly causing noise.
    
    Change-Id: Idd556c348cc0e97e38c710fdbf76fe20c76d8f9b
    Reviewed-on: https://gerrit.libreoffice.org/36241
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/test/httpwserror.cpp b/test/httpwserror.cpp
index 254b2982..ff417f25 100644
--- a/test/httpwserror.cpp
+++ b/test/httpwserror.cpp
@@ -117,7 +117,7 @@ void HTTPWSError::testMaxDocuments()
     static_assert(MAX_DOCUMENTS >= 2, "MAX_DOCUMENTS must be at least 2");
     const auto testname = "maxDocuments ";
 
-    if (MAX_DOCUMENTS > 200)
+    if (MAX_DOCUMENTS > 20)
     {
         std::cerr << "Skipping " << testname << "test since MAX_DOCUMENTS (" 
<< MAX_DOCUMENTS
                   << ") is too high to test. Set to a more sensible number, 
ideally a dozen or so." << std::endl;
@@ -168,7 +168,7 @@ void HTTPWSError::testMaxConnections()
     static_assert(MAX_CONNECTIONS >= 3, "MAX_CONNECTIONS must be at least 3");
     const auto testname = "maxConnections ";
 
-    if (MAX_CONNECTIONS > 300)
+    if (MAX_CONNECTIONS > 40)
     {
         std::cerr << "Skipping " << testname << "test since MAX_CONNECTION (" 
<< MAX_CONNECTIONS
                   << ") is too high to test. Set to a more sensible number, 
ideally a dozen or so." << std::endl;
@@ -223,7 +223,7 @@ void HTTPWSError::testMaxViews()
     static_assert(MAX_CONNECTIONS >= 3, "MAX_CONNECTIONS must be at least 3");
     const auto testname = "maxViews ";
 
-    if (MAX_CONNECTIONS > 200)
+    if (MAX_CONNECTIONS > 40)
     {
         std::cerr << "Skipping " << testname << "test since MAX_CONNECTION (" 
<< MAX_CONNECTIONS
                   << ") is too high to test. Set to a more sensible number, 
ideally a dozen or so." << std::endl;
diff --git a/test/httpwstest.cpp b/test/httpwstest.cpp
index 27b698d7..5b364fd2 100644
--- a/test/httpwstest.cpp
+++ b/test/httpwstest.cpp
@@ -2201,7 +2201,7 @@ void HTTPWSTest::testEachView(const std::string& doc, 
const std::string& type,
         // Connect and load 0..N Views, where N<=limit
         std::vector<std::shared_ptr<LOOLWebSocket>> views;
         static_assert(MAX_DOCUMENTS >= 2, "MAX_DOCUMENTS must be at least 2");
-        const auto limit = std::max(2, MAX_DOCUMENTS - 1); // +1 connection 
above
+        const auto limit = std::min(4, MAX_DOCUMENTS - 1); // +1 connection 
above
         for (itView = 0; itView < limit; ++itView)
         {
             views.emplace_back(loadDocAndGetSocket(_uri, documentURL, 
Poco::format(view, itView)));
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 439ab67e..0fe28328 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -747,7 +747,8 @@ void LOOLWSD::initialize(Application& self)
 
     // Log the connection and document limits.
     static_assert(MAX_CONNECTIONS >= 3, "MAX_CONNECTIONS must be at least 3");
-    static_assert(MAX_DOCUMENTS > 0 && MAX_DOCUMENTS <= MAX_CONNECTIONS, 
"MAX_DOCUMENTS must be positive and no more than MAX_CONNECTIONS");
+    static_assert(MAX_DOCUMENTS > 0 && MAX_DOCUMENTS <= MAX_CONNECTIONS,
+                  "max_documents must be positive and no more than 
max_connections");
     LOG_INF("Maximum concurrent open Documents limit: " << MAX_DOCUMENTS);
     LOG_INF("Maximum concurrent client Connections limit: " << 
MAX_CONNECTIONS);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to