Skip to content
Commit fa427c66 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Try to fix autoconfigkolabmailtest on the CI

After some lengthy investigation I found that the problem with failing mailtest
is that it tries to talk to the errorserver.py before the server actually starts
listening on the port. This causes KIO to return KIO::ERR_COULD_NOT_CONNECT,
which is handled the same way as if the server returned HTTP 500 or 404. That's
why all the failure test passed and only the one that actually tested success
scenario was failing. The situation can be observed via Wireshark when the test
is getting RES/ACK response to SYN when trying to connect to the server which
indicates that the connection was refused (i.e. nothing is listening).

The test passes locally in most cases because our computers are fast and so
Python has enough time to set up everything and start listening before the
test tries to connect, however on the CI machines the test will usually be
faster than the Python interpret.

The important question was why this was only affecting the kolabmailtest and
not the other tests on CI. The (most probable) reason is that kolabmailtest is
the only test that starts talking to the server right after it launches the
server. The other tests have at least one test function that tests parsing or
something like that, so most probably the time these test functions take is
enough for the server to start up completely even on the CI builders.

The situation can be reproduced by adding time.sleep(1) before run() to
errorserver.py and running the tests (without this patch) - they all fail the
same way. With this patch we make sure that we can connect to the server
(i.e. that it's ready and listening for incomming connections) before running
the actual tests.
parent 314a7821
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment