aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-05-14 16:03:27 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-05-14 16:14:48 +0200
commit66c2fe512ac4a4cf145f3e9bc9227552febc48bb (patch)
tree0b59ec2c3e91f94a77b42e5416cd2d364436ab85
parenteffb59934410c561087578ecdd431f4db8da91ce (diff)
Speed up test bug_927.py
Bring the execution time from 4s to ~200ms on a normal machine. Pick-to: 6.7 6.5 Change-Id: If57aa5a73089f48cba1b7bcf6789864d8dfbb48c Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
-rw-r--r--sources/pyside6/tests/QtCore/bug_927.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/pyside6/tests/QtCore/bug_927.py b/sources/pyside6/tests/QtCore/bug_927.py
index 1ecea61b2..c15a7014b 100644
--- a/sources/pyside6/tests/QtCore/bug_927.py
+++ b/sources/pyside6/tests/QtCore/bug_927.py
@@ -24,7 +24,7 @@ class thread_function():
class Task(QRunnable):
def run(self):
- QThread.sleep(2) # Sleep 2 seconds
+ QThread.msleep(100)
class QThreadPoolTest(unittest.TestCase):
@@ -34,15 +34,15 @@ class QThreadPoolTest(unittest.TestCase):
for i in range(3):
task = Task()
QThreadPool.globalInstance().start(task)
- time.sleep(1) # Sleep 1 second
+ time.sleep(0.05)
- QThreadPool.globalInstance().waitForDone()
+ self.assertTrue(QThreadPool.globalInstance().waitForDone())
def testCallable(self):
global thread_function_called
tp = QThreadPool.globalInstance()
tp.start(thread_function)
- tp.waitForDone()
+ self.assertTrue(tp.waitForDone())
self.assertTrue(thread_function_called)