[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ktexteditor] autotests/src/vimode: Fix flaky test - a "coarse" timer - like the one used by the com
From: Simon St James <kdedevel () etotheipiplusone ! com>
Date: 2016-06-17 8:18:09
Message-ID: E1bDoyf-0002ZN-Ar () scm ! kde ! org
[Download RAW message or body]
Git commit 9eb1cdbf29ab58aa977c563129b97e58dc18b318 by Simon St James.
Committed on 17/06/2016 at 08:14.
Pushed by sstjames into branch 'master'.
Fix flaky test - a "coarse" timer - like the one used by the command response message \
timeout QTimer - can fire up to 500ms off from when it is scheduled - including \
firing 500ms *before* scheduled.
M +1 -1 autotests/src/vimode/emulatedcommandbar.cpp
http://commits.kde.org/ktexteditor/9eb1cdbf29ab58aa977c563129b97e58dc18b318
diff --git a/autotests/src/vimode/emulatedcommandbar.cpp \
b/autotests/src/vimode/emulatedcommandbar.cpp index 36a6b09..fecfcbd 100644
--- a/autotests/src/vimode/emulatedcommandbar.cpp
+++ b/autotests/src/vimode/emulatedcommandbar.cpp
@@ -1515,7 +1515,7 @@ void EmulatedCommandBarTest::EmulatedCommandBarTests()
// Be a bit vague about the exact message, due to i18n, etc.
QVERIFY(commandResponseMessageDisplay()->text().contains("commandthatdoesnotexist"));
waitForEmulatedCommandBarToHide(4 * commandResponseMessageTimeOutMS);
- QVERIFY(timeJustBeforeCommandExecuted.msecsTo(QDateTime::currentDateTime()) >= \
commandResponseMessageTimeOutMS); + \
QVERIFY(timeJustBeforeCommandExecuted.msecsTo(QDateTime::currentDateTime()) >= \
commandResponseMessageTimeOutMS - 500); // "- 500" because coarse timers can fire up \
to 500ms *prematurely*. QVERIFY(!emulatedCommandBar->isVisible());
// Piggy-back on this test, as the bug we're about to test for would actually make \
setting // up the conditions again in a separate test impossible ;)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic