1
+ from packaging import version
2
+
1
3
from arango .exceptions import (
2
4
AQLCacheClearError ,
3
5
AQLCacheConfigureError ,
@@ -26,7 +28,7 @@ def test_aql_attributes(db, username):
26
28
assert repr (db .aql .cache ) == f"<AQLQueryCache in { db .name } >"
27
29
28
30
29
- def test_aql_query_management (db , bad_db , col , docs ):
31
+ def test_aql_query_management (db_version , db , bad_db , col , docs ):
30
32
plan_fields = [
31
33
"estimatedNrItems" ,
32
34
"estimatedCost" ,
@@ -162,7 +164,7 @@ def test_aql_query_management(db, bad_db, col, docs):
162
164
assert new_tracking ["track_bind_vars" ] is True
163
165
assert new_tracking ["track_slow_queries" ] is True
164
166
165
- # Kick off some long lasting queries in the background
167
+ # Kick off some long- lasting queries in the background
166
168
db .begin_async_execution ().aql .execute ("RETURN SLEEP(100)" )
167
169
db .begin_async_execution ().aql .execute ("RETURN SLEEP(50)" )
168
170
@@ -175,6 +177,8 @@ def test_aql_query_management(db, bad_db, col, docs):
175
177
assert "state" in query
176
178
assert "bind_vars" in query
177
179
assert "runtime" in query
180
+ if db_version >= version .parse ("3.11" ):
181
+ assert "peak_memory_usage" in query
178
182
assert len (queries ) == 2
179
183
180
184
# Test list queries with bad database
0 commit comments