Skip to content

Commit

Permalink
[postgres][test] Check QgsFeatureRequest.connectionTimeout flag
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 29, 2017
1 parent 29e8990 commit 5dbeaf5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/python/test_provider_postgres.py
Expand Up @@ -339,6 +339,18 @@ def testNestedInsert(self):
self.vl.addFeature(f) # Should not deadlock during an active iteration
f = next(it)

def testTimeout(self):
"""
Asserts that we will not deadlock if more iterators are opened in parallel than
available in the connection pool
"""
request = QgsFeatureRequest()
request.setConnectionTimeout(1)

iterators = list()
for i in range(100):
iterators.append(self.vl.getFeatures(request))

def testTransactionNotDirty(self):
# create a vector ayer based on postgres
vl = QgsVectorLayer(self.dbconn + ' sslmode=disable key=\'pk\' srid=4326 type=POLYGON table="qgis_test"."some_poly_data" (geom) sql=', 'test', 'postgres')
Expand Down

0 comments on commit 5dbeaf5

Please sign in to comment.