Skip to content

Commit 1668754

Browse files
authored
Remove concurrency test from pg
it has been added to providerbase
1 parent e5fce1e commit 1668754

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

tests/src/python/test_provider_postgres.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,32 +1141,6 @@ def testCurveToMultipolygon(self):
11411141
self.assertEqual(g.childCount(), 1)
11421142
self.assertTrue(g.childGeometry(0).vertexCount() > 3)
11431143

1144-
def testConcurrency(self):
1145-
"""
1146-
The connection pool has a maximum of 4 connections defined (+2 spare connections)
1147-
Make sure that if we exhaust those 4 connections and force another connection
1148-
it is actually using the spare connections and does not freeze.
1149-
This situation normally happens when (at least) 4 rendering threads are active
1150-
in parallel and one requires an expression to be evaluated.
1151-
"""
1152-
vl = QgsVectorLayer('{conn} srid=4326 table="qgis_test".{table} (geom) sql='.format(conn=self.dbconn, table='someData'), "testgeom", "postgres")
1153-
self.assertTrue(vl.isValid())
1154-
QgsProject.instance().addMapLayer(vl)
1155-
1156-
# Acquire the maximum amount of concurrent connections
1157-
iterators = list()
1158-
for i in range(QgsApplication.instance().maxConcurrentConnectionsPerPool()):
1159-
iterators.append(vl.getFeatures())
1160-
1161-
# Run an expression that will also do a request and should use a spare
1162-
# connection. It just should not deadlock here.
1163-
1164-
feat = next(it)
1165-
context = QgsExpressionContext()
1166-
context.setFeature(feat)
1167-
exp = QgsExpression('get_feature(\'{layer}\', \'pk\', 5)'.format(layer=vl.id()))
1168-
exp.evaluate(context)
1169-
11701144

11711145
class TestPyQgsPostgresProviderCompoundKey(unittest.TestCase, ProviderTestCase):
11721146

0 commit comments

Comments
 (0)