We now use our http::Socket and SocketPoll
instead of Poco.
UnitEachView now finishes ~3x faster.
It's also much more consistent in its
runtime.
More importantly, the CPU utilization
went from ~20% to ~90%. Poco was spending
most of its time polling (and often timing
out). It has corner-cases that make it
miss events completely, for some reason.
Change-Id: Ibcc8fbd638e5ec950a34b418414521accdd443f8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Now the remaining tests that didn't have a name
get one and the logs are unified between old-
and new-style tests. Mostly.
This makes sure that all logs and assertions
properly log the test name and make test
failures easier to debug and fix.
Change-Id: Id159ffacc81642a6ec594c5143498408adab67cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
When config.h is not included, the build
configuration is missing from the translation
unit in question. This affects ENABLE_SSL,
for one.
Also, HttpRequest.hpp depends on LOOLWSD_VERSION,
which is defined in config.h.
The config.h header must be included in all
trasnlation-units, and must be the first include.
This is to avoid conflicts and/or mismatching
binaries built with different compile-time values.
We also statically assert if LOOLWSD_VERSION
is not defined, to help the error message.
Change-Id: Ic4b45de879f3360a07e9507fdf04abfa4cec6a71
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
size_t in C and in C++ are not necessarily the same
type. The C++ size_t is in the std namespace. Since
we do include many C headers, and indeed some C++
runtime headers do define size_t for backwards
compatibility, it's easy to mix and match the two
types.
Also, 'using std::size_t;' isn't a great practice,
so removed.
This is not exhaustive, just some low-hanging cases.
Change-Id: I85a36b6fd1acd204274b1869de9bcb94c8b3cf13
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
We used to just timeout when there was no match due to a missing
assignment.
This also shows that some of the tests don't pass currently, so for now
blacklist what's not working.
Change-Id: I777f5acffc83349d7cc0e92af99059495610f612
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96569
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Because the new-style tests are intrustive,
the exception that CppUnit throws on assertion
failures is caught and processed with the
application logic, which is far from ideal,
because it's very difficult to find the
cause of failure.
What we'd like is a way to control what happens
when an test assertion fails, such that we can
properly log/print the failure, and even break
in the debugger.
The new macros allow us to control the behavior
at compile-time and have added flexibility.
For now, they log an assertion failure before
invoking the CPPUNIT macro, and support a
compile-time directive to assert, which is
useful for breaking in the debugger.
Change-Id: If464ba246e3ec747f31496a4215cb73ef735dfaf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87625
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
I think this is the last case where sanitizers cause enough slowdown
that the test fails due to a timeout. The new limit is 4 minutes, the
test passes for me in 2m20s with sanitizers.
Change-Id: I7fccb593d67908bfaeba8eb8715d00cce48e84fb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88916
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
With this, the test passes under sanitizers as well.
Change-Id: I777e177d4f171328744cf83386276752d51700cc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88584
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>