Commit graph

36 commits

Author SHA1 Message Date
Andras Timar
f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Michael Meeks
b043b6213d Move LOOLWebSocket into test/ - where it can be slowly removed.
Change-Id: I388690261d323377648a1502b927e73f862ad802
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-11 13:40:20 +01:00
Ashod Nakashian
b47c81e7a8 wsd: improved WebSocketSession interface
SocketPoll is captured as weak_ptr into
WebSocketSession and a much better shutdown
support is now available. The new logic
can do async-shutdown after flushing and
will do sync-shutdown if SocketPoll is
no longer around.

Change-Id: Ia206cab58a13f20f7aeb3a6d8c57afee731c8231
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Miklos Vajna
1ff7f2704b unit-crash: avoid socket deletion before _socketPoll completes the async shutdown
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibb9f7d7681d502d06de92c2f5d8305c3f27a76c0
2021-04-22 09:55:03 +02:00
Ashod Nakashian
ad52aea7ba wsd: test: killpoco in crashtest
Change-Id: Iad87dcb6c25271df75a5b397bb94bb1aecfc7d38
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Gabriel Masei
21d514ecff admin: add support for lost kits cleanup
Signed-off-by: Gabriel Masei <gabriel.masei@1and1.ro>
Change-Id: I31969196aa138b6da964c867679ec23f34c89fd0
2021-04-01 22:09:44 +01:00
Ashod Nakashian
1f978d9b50 wsd: cleanup Poco headers
Change-Id: I1eec2301576fc2f1cde40389b1f858f80b1204c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
95bb52d945 wsd: test: better logging
Change-Id: I3d17afb2e76f1d4b2b27182a6419482801342e8c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-08 22:49:53 -05:00
Ashod Nakashian
42f5ceae42 wsd: test: improvements
This reduces the execution time of some
long-running tests and improves stability.

A full debug build of Core and Online
now finishes on my machine in under 3 minutes,
down from slightly over 4 minutes. A significant
saving when running the tests frequently and
repeatedly.

Change-Id: I66c1b06ec3c9e8ab90a30f3a15c03f8d560ed3c6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-01-23 23:55:43 +00:00
Ashod Nakashian
d2e29d592a wsd: test: httpcrashtest drain using the getErrorCode helper
Reading the messages using a different helper means
we may miss (=consume without checking) the close frame.

Change-Id: I93a529723ba8d2b516319d54496c56c7e6d7da27
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2020-12-28 12:04:53 -04:00
Andras Timar
0002fdfd6c fix license headers
Change-Id: I8623770b32d278a45357dc7f757fabfadd2b4af7
2020-10-01 11:56:43 +02:00
Pranam Lashkari
8aa42bc1ba killpoco: removed Poco::Thread from net directory
Removed unused Poco/Thread.h header

Change-Id: Iafcd32656f0153ec97a4db0fe0259e8b34f79add
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/83290
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-04 13:57:46 +02:00
Michael Meeks
3e4ac31c7c killpoco: remove WebSocket includes from a couple of places.
Change-Id: I06740cd978bec8e6a74beb8ed9ef8f4f970a2535
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92470
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-04-18 18:29:04 +02:00
Ashod Nakashian
82560d9657 wsd: test assertion macros
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>
2020-03-14 15:45:00 +01:00
Michael Meeks
9126a641a9 test: switch to using ClientPortNumber to allow parallelism.
Change-Id: Ifef3bce1b217605000300b240ea74df4d264e0df
2020-01-21 15:07:54 +00:00
Pranam Lashkari
d7bc9ff2e4 killpoco: removed StringTokenizer from test directory
removed use of Poco::StringTokenizer from the test directory using LOOLProtocol::tokenize and std::vecor<std::string>

Change-Id: I20fc2e0ef0d0d8fc959fee7972aa095f2581c181
Reviewed-on: https://gerrit.libreoffice.org/82565
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-11-13 09:20:25 +01:00
Miklos Vajna
51b8ed7309 Try to avoid a timing problem in HTTPCrashTest::testRecoverAfterKitCrash()
In case we fail to open the document, try again in 2 seconds (same value
as in HTTPServerTest::testConvertTo()). This seems to be needed fore
core.git dbgutil builds, but don't do that unconditionally, in case the
sleep is not needed for optimized core.git.

Change-Id: I4585d1f273bfa5fffc4b02bc6107f27a2c9e1280
2019-08-30 12:22:11 +02:00
Miklos Vajna
6fb9fcceca Disable HTTPCrashTest::testBarren() for now
Till it's clear how to fix it, so 'make check' keeps passing, without a
second consistently failing test appearing.

Change-Id: I80a1ebd2b1264819c3e98f816b4c13984b961fbb
2019-05-21 09:10:40 +02:00
Michael Meeks
264450758a test: close testCrashKit race.
LOOLWSD is conservative and leaves forkit to start processes for a
while. If we kill a kit before it has started and registered we can
end up with LOOLWSD holding off to wait for the (now dead) kit, and
the tearDown assertions that we have 1 kit failing.

Change-Id: Id25e48bf55d1757d2223816293500fde6ff9df1b
Reviewed-on: https://gerrit.libreoffice.org/71811
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2019-05-05 00:04:00 +02:00
Tor Lillqvist
3b4269a301 Use Util::symbolicErrno()
I think the general policy should be to always log errno using both
Util::symbolicErrno() and std::strerror(), never log a naked errno.
But only in cases where we know that it is highly likely that it is
the most recent system call that has failed, so errno makes sense.

Change-Id: I4a1fb31e375ea949e7da17687464361efe7c1761
2018-07-11 13:05:22 +03:00
Michael Meeks
ac0f61adad Count kits better for crash testing.
Change-Id: Icf04d4124e2b538886c8568358e94d00baeefeb4
2018-05-18 15:55:57 +01:00
Ashod Nakashian
7be98efd93 ut: log timestamp to track timeouts better
And improve the logging support in unit-tests to
help troubleshoot issues faster and more accurately.
Also makes the code more readable (hopefully).

Change-Id: I4f8aafb5245e2f774b03231591a74544f9ec84aa
Reviewed-on: https://gerrit.libreoffice.org/48645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:21:15 +01:00
Miklos Vajna
4bcfdbb5b3 test: spell out non-trivial autos to improve readability
Change-Id: Ie3b4b961c50ab61ef63380c4724a0f00e8f960d2
2018-02-07 10:18:12 +01:00
Pranav Kant
f63858433b loplugin:includeform
Change-Id: Ib62a7aa61062f00698aa3e8a144438de5c57e53d
2017-12-20 21:21:05 +05:30
Michael Meeks
def0350379 Re-factor pid hunting code into test.cpp where we can do better.
Prepare the ground for using WSD hooks for this.

Change-Id: I5c3e32396b335ad189472ab3a51044372ee304b2
2017-09-19 21:16:44 +01:00
Michael Meeks
097cc58d53 Run old-style unit tests as a new-style unit test.
This moves the code into the same process, for easier logging & debugging.

Disabled initially.

Change-Id: Id48b5649ba14deb0a2159ca59e321c7d0ae66dad
2017-06-02 18:33:26 +01:00
Ashod Nakashian
9c14446c88 wsd: re-enable a couple more tests that are stable
Change-Id: I01bc96ce7bde7cac10d0b4d023b0d5dd774ed058
Reviewed-on: https://gerrit.libreoffice.org/36602
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:12:16 +02:00
Jan Holesovsky
fb4fbdd575 Disable the unreliable unit tests.
Change-Id: I1de9cc566b1b88563152aa36a5505867e46ea2af
2017-04-06 16:58:42 +01:00
Ashod Nakashian
58d3b7f9ff wsd: new test to validate recovery after kit crash
Change-Id: I406e5b72f6edf46dfde5da8c07daed21aef8b130
2017-03-20 21:33:59 -04:00
Ashod Nakashian
88bbc303dc nb: unittest improvements
Change-Id: Ife4ed343d54137f254077d4f194157120cf82bad
2017-03-10 10:47:41 +01:00
Ashod Nakashian
2be0d16e7b wsd: improved crash kit test
Change-Id: Iddc056383aa37bfe278d4f4003b56696b8f2bf13
Reviewed-on: https://gerrit.libreoffice.org/33118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:48:43 +00:00
Ashod Nakashian
4e9e019564 wsd: refactor/dedup the lokit process counting tests
Change-Id: Iebf7756c6a5c2bc581a0ade4fe13fad752eb7d20
Reviewed-on: https://gerrit.libreoffice.org/32861
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:18:43 +00:00
Ashod Nakashian
94b2262e27 wsd: don't test for pathological Poco behavior in our unittests
Change-Id: Ia7122eacce836aab5bef29c16529cbed16856be8
Reviewed-on: https://gerrit.libreoffice.org/32625
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:12:42 +00:00
Noel Grandin
4ed820d3d5 add a configure option for using clang compiler plugins
and apply the nullptr plugin.

Lots of hacking in my LO tree required to make this work, will probably
end up needing to add an extra parameter to the LO side.

Change-Id: I02ae1dcdece9d9ddf05f7757f6696e3a5d7d1f14
Reviewed-on: https://gerrit.libreoffice.org/32339
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-22 14:23:42 +00:00
Michael Meeks
c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Renamed from loolwsd/test/httpcrashtest.cpp (Browse further)