@@ -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
11711145class TestPyQgsPostgresProviderCompoundKey (unittest .TestCase , ProviderTestCase ):
11721146
0 commit comments