diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-11-30 18:22:52 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-12-07 09:26:54 +0100 |
| commit | 5068d5f7962f36c89739866f0974463dbb87b0e8 (patch) | |
| tree | 19c9b581b52f66316d64267f6dc134b423d4388d | |
| parent | e3ff4b4e004e35c7be4fa6b4d3a4704bf98806a9 (diff) | |
PySide6: Prospective fix for stabilizing test qthread_prod_cons_test.py
Terminate the test only by the consumer. Verify the wait() statements.
Pick-to: 6.2
Change-Id: I811dd48c6522319efc7351bad683c6d3a6e25def
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
| -rw-r--r-- | sources/pyside6/tests/QtCore/qthread_prod_cons_test.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py index dbe37416e..6351eadd2 100644 --- a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py +++ b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py @@ -120,26 +120,20 @@ class ProducerConsumer(unittest.TestCase): # PYSIDE-535: Need to collect garbage in PyPy to trigger deletion gc.collect() - def finishCb(self): - # Quits the application - self.app.exit(0) - def testProdCon(self): # QThread producer-consumer example bucket = Bucket() prod = Producer(bucket) cons = Consumer(bucket) + cons.finished.connect(QCoreApplication.quit) prod.start() cons.start() - prod.finished.connect(self.finishCb) - cons.finished.connect(self.finishCb) - self.app.exec() - prod.wait(50) - cons.wait(50) + self.assertTrue(prod.wait(1000)) + self.assertTrue(cons.wait(1000)) self.assertEqual(prod.production_list, cons.consumption_list) |
