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