]> cloud.milkyroute.net Git - dolphin.git/commit
Improve stability of unit tests when running them with Valgrind
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 14 Apr 2011 10:57:46 +0000 (12:57 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 14 Apr 2011 11:10:33 +0000 (13:10 +0200)
commit6d7e993c26d17582402adf3d662a0f5b16e684a7
tree3469f644727d9885b3fada157b2f3c1780807c5b
parente152885d9435a6049cf033addbae6fa303900794
Improve stability of unit tests when running them with Valgrind

I noticed unexpected unit test failures when running the tests with
Valgrind. The reason was that test execution was slowed down a lot,
such that that TestBase::waitForFinishedPathLoading() did not receive
the view's signal within the default timeout of 2 seconds, and that
this failure was not detected in every test -> the tests failed later
on because not all expected items had been loaded yet.

To fix this, I changed two things:
1. Added an assert in TestBase::waitForFinishedPathLoading() that checks
if the signal has been received. Continuing does not make much sense if
that is not the case.
2. Increased the default timeout to 20 seconds. The reason why there is
a finite timeout at all is that I didn't want to waste too much time on
machines where the file kioslave seems to have problems loading a
directory (I've seen corresponding test logs at cdash.org). However, with
the first change I mentioned above, the waiting time is lost only once
(due to the assert) rather than every time a directory is loaded
-> I think that the timeout increase does not lead to an increased waste
of time on such machines.
src/tests/dolphindetailsviewtest.cpp
src/tests/dolphinviewtest_allviewmodes.cpp
src/tests/testbase.cpp
src/tests/testbase.h