Commit graph

24 commits

Author SHA1 Message Date
Andras Timar
1fd5dbd787 Do not use the word 'Error' here (tinderbox)
Change-Id: If5bbfceb624974801ffb84e52e6aa1b7e599a7ae
2018-06-15 15:14:14 +02:00
Ashod Nakashian
2562d8919a ut: log the test name for easier traceability
Change-Id: Icbcbb36857b748c2ac2d0d36a5c4c23609f5453a
Reviewed-on: https://gerrit.libreoffice.org/49568
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-11 19:22:14 +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
Miklos Vajna
de785d90b2 test: give the socket the chance to get the error in getErrorCode()
make check fails for me like this:

Test name: HTTPCrashTest::testCrashKit
equality assertion failed
- Expected: 1001
- Actual  : 65535

Failures !!!
Run: 1   Failure total: 1   Failures: 1   Errors: 0

But when I run loolwsd and ./test manually (./test is invoked by gdb) and I
step through the code, then the test passes. So I guess what happens is that we
read from the socket too fast, and the error we're looking for is just not
there yet. Add the same amount of sleep here (0.5s) than what's used in
connectLOKit(), with that the test passes fine.

(The sleep is in test-only code.)

Change-Id: Iff105c45f21c40c2fb0a649fc9fd9a9065e7c952
Reviewed-on: https://gerrit.libreoffice.org/38846
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-06-16 07:47:20 +02:00
Ashod Nakashian
7b9e949adc wsd: add test helper to get server version
Change-Id: I14ce574d4593d845f6621b447a678f2c4bbe29ac
Reviewed-on: https://gerrit.libreoffice.org/37131
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-02 06:13:08 +02:00
Ashod Nakashian
647e5f8936 wsd: unittest to reproduce rendering issue in Calc
The following scenario causes rendering failure
where blank tiles are returned.

1. Load doc where the cursor is saved to a top cell.
2. Page down (typically several 100th row).
3. Load a new view to the same doc (do nothing else).
4. In the first view up-arrow to move cursor and invalidate.
5. New tile is rendered incorrectly.

Change-Id: I06c7627d1b74d9e3be3e83d9d9a09cb5479ba660
Reviewed-on: https://gerrit.libreoffice.org/37129
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-05-02 06:12:27 +02:00
Ashod Nakashian
0feea0e80e wsd: include cleanup in test
Change-Id: Ie54aabc74e8980f3131a66f3610c1dcdd9f668ff
Reviewed-on: https://gerrit.libreoffice.org/36600
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-17 07:08:58 +02:00
Ashod Nakashian
95d51493aa wsd: remove nextmessage
This was a workaround to Poco's limitation
of requiring socket receiveFrame be given
preallocated buffer, which couldn't be
exceeded by a larger payload. This meant
the receiver had to know the maximum
payload in advance.

Since only the Kit uses Poco sockets,
and the Kit never receives large payloads,
this preamble is now obsolete.

100% (94/94) of old-style tests PASS.

Change-Id: I76776f89497409e5755e335a3e25553e91cf0876
Reviewed-on: https://gerrit.libreoffice.org/36037
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-04-03 05:18:09 +00:00
Michael Meeks
0eaef6c896 config.h - get includes right: must always be the first include. 2017-03-10 10:47:43 +01:00
Ashod Nakashian
88bbc303dc nb: unittest improvements
Change-Id: Ife4ed343d54137f254077d4f194157120cf82bad
2017-03-10 10:47:41 +01:00
Ashod Nakashian
c845890630 nb: log the test name where possible
Helps troubleshoot failed tests faster.

Change-Id: I12172bcdd46403b902bf440b919916263cb1a02b
2017-03-10 10:47:41 +01:00
Jan Holesovsky
5873d15c62 fuzzer: Use the dummy LOK implementation when fuzzing.
Now it is possible to use:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:storage.filesystem[@allow]=true --o:logging.level=fatal --fuzz=/tmp/looltrace

Ie. no need to specify the LibreOffice install location.  Ideally worth
disabling the logging output too, to gain higher performance.

Change-Id: I4fa5f275cd4f4a52fe2cd07e658cea726f6f31c2
2017-02-08 11:54:50 +01:00
Jan Holesovsky
964ae25ccf fuzzer: Factor out the replay functionality to a separate file.
Change-Id: Ief946b1703ef1ca0b17de3467dce66b4c3da2601
2017-02-08 08:35:13 +01:00
Ashod Nakashian
0f73bd9bf2 wsd: improved testConnectNoLoad
Change-Id: I8eff5b4862067444c8623582dc4f3baa585f164e
Reviewed-on: https://gerrit.libreoffice.org/33425
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:41:46 +00:00
Ashod Nakashian
8cbf478bfe wsd: improved getErrorCode
Change-Id: I89b36b5e69cbbe05ac7b1730633d695bc5185823
Reviewed-on: https://gerrit.libreoffice.org/33117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:45:03 +00:00
Ashod Nakashian
4580ed4e27 wsd: prefix the test docs with the test name
This makes debugging much easier as one can
readily match WSD logs with a given test.

Change-Id: I8f2c83d67189038699af3f24dee205bc7efb5c28
Reviewed-on: https://gerrit.libreoffice.org/32860
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-09 06:17:43 +00:00
Ashod Nakashian
606f85db87 wsd: fixup max connections unittest
Change-Id: I107dadb973554b21f20211c8316cec7139953f47
Reviewed-on: https://gerrit.libreoffice.org/32713
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-04 04:31:00 +00:00
Ashod Nakashian
7dad1c5f6a wsd: more forgiving canceltiles unittests
canceltiles is not guaranteed to prevent
tiles from getting sent back to the client.

There is an obvious race between receiving
tile requets and cancelling them.

This reduces failures by repeating the
unittest when there is spurious failure.

Change-Id: Icf299e2212e175dc4c0cbc1d2f91c37725f2b261
Reviewed-on: https://gerrit.libreoffice.org/32631
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-02 06:17:21 +00:00
Noel Grandin
f56549753a loplugin:passstuffbyref
Change-Id: Ib9208e7585dbb8dfeab713daa173af190d9efebc
Reviewed-on: https://gerrit.libreoffice.org/32363
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2016-12-27 10:20:44 +00:00
Ashod Nakashian
6ab32e0aa9 loolwsd: use larger threshold to large messages
Messages larger than a certain size are preambled
with a 'nextmessage' message that hold the size
of the subsequent message.

This is a workaround to a limitation the Poco
WebSocket API where if the buffer size is
smaller than the received frame the socket
ends up in a bad state and must be closed.
Unfortunately the new API that avoids this
workaround is not yet released by Poco.

Here we minimize the need for 'nextmessage'
to truely large messages. The limit is now
raised from above 1KB to over 63KB.

We may raise this limit further, but that will
cost each socket that much dedicated buffer size.

Change-Id: I01e4c68cdbe67e413c04a9725152224a87ab8267
Reviewed-on: https://gerrit.libreoffice.org/31286
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:54:37 +00:00
Ashod Nakashian
a8f3263132 loolwsd: use more efficient matchPrefix
Change-Id: I6f34b314295335270ff4da2827517d818c6a62ab
Reviewed-on: https://gerrit.libreoffice.org/31285
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-11-28 04:53:04 +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/helpers.hpp (Browse further)