Skip to content

Commit 154e71e

Browse files
NambrokWescoeur
andcommitted
Fix XAPI session leak by vdi_is_open
In the case of `vdi_is_open` tests, we are using a script to obtain the sr_ref of XAPI. This script doesn't free the XAPI session it obtained. ``` Apr 15 09:46:55 r620-x1 xapi: [debug||115 db_gc|DB GC D:d2304dcf287c|db_gc_util] Session.destroy _ref=OpaqueRef:77699499-92e7-ad96-2703-fc53adaae642 uuid=e8a67d26-9aae-4451-ea87-66a3180141fb trackid=3c4e5b67d27d1b17ff45f3e41b478632 (last active 20260414T07:46:32Z): Timed out session in group 'originator:xcp-ng-tests session' because of its age ``` This add the logout to the script to avoid leaking the session. Signed-off-by: Damien Thenot <damien.thenot@vates.tech> Co-authored-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 176ea6d commit 154e71e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/storage/storage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ def get_xapi_session():
139139
return session
140140
141141
session = get_xapi_session()
142-
sr_ref = session.xenapi.SR.get_by_uuid(\"{sr.uuid}\")
142+
try:
143+
sr_ref = session.xenapi.SR.get_by_uuid(\"{sr.uuid}\")
144+
finally:
145+
session.xenapi.logout()
143146
print(sr_ref)
144147
"""
145148

0 commit comments

Comments
 (0)