diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-12-09 11:23:04 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-12-14 14:39:58 +0000 |
commit | b750a3786f42395f0cddd8ed8f92a2bcfda1b270 (patch) | |
tree | 5f59c04b3288edd296ad69e73200d9ce80f2d40a /tests | |
parent | 311e523ceffc5338e63f0468701e9307d9c3defa (diff) |
Lower timeout on tst_QSemaphore::tryAcquireWithTimeout
The test was so slow it was blacklisted on all platforms for timing out.
This patch lowers the timeout to a 5th and tries removing the blacklist.
Change-Id: Ib28b21de572517c548a14300f26815598efe91e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/thread/qsemaphore/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp | 6 |
2 files changed, 3 insertions, 6 deletions
diff --git a/tests/auto/corelib/thread/qsemaphore/BLACKLIST b/tests/auto/corelib/thread/qsemaphore/BLACKLIST deleted file mode 100644 index 9f6f6e3ba6..0000000000 --- a/tests/auto/corelib/thread/qsemaphore/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -# Times out randomly on linux, windows, osx -[tryAcquireWithTimeout] -* diff --git a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp index 8597bf1a6d..f1eb32a282 100644 --- a/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp +++ b/tests/auto/corelib/thread/qsemaphore/tst_qsemaphore.cpp @@ -202,8 +202,8 @@ void tst_QSemaphore::tryAcquireWithTimeout_data() { QTest::addColumn<int>("timeout"); - QTest::newRow("1s") << 1000; - QTest::newRow("10s") << 10000; + QTest::newRow("0.2s") << 200; + QTest::newRow("2s") << 2000; } void tst_QSemaphore::tryAcquireWithTimeout() @@ -212,7 +212,7 @@ void tst_QSemaphore::tryAcquireWithTimeout() // timers are not guaranteed to be accurate down to the last millisecond, // so we permit the elapsed times to be up to this far from the expected value. - int fuzz = 50; + int fuzz = 50 + (timeout / 20); QSemaphore semaphore; QElapsedTimer time; |