Changeset 99100 in vbox
- Timestamp:
- Mar 21, 2023 5:25:26 PM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/tests/api/tdTreeDepth1.py
r99084 r99100 45 45 import sys 46 46 import random 47 import time47 import gc 48 48 49 49 # Only the main script needs to modify the path. … … 238 238 oVM = None; 239 239 240 # Fudge factor: When unregistering a VM with CleanupMode_UnregisterOnly the 241 # associated medium objects will be closed when the Machine object is 242 # uninitialized so wait for that to complete. Otherwise the check for 243 # cBaseImages below will race with the VM uninitialization and depending on 244 # which one wins can cause a test failure. 245 reporter.log('Waiting five seconds for Machine::uninit() to be called to close the attached disks'); 246 time.sleep(5); 240 # When unregistering a VM with CleanupMode_UnregisterOnly the associated medium's 241 # objects will be closed when the corresponding Machine object ('oVM') is 242 # uninitialized. Assigning the 'None' object to 'oVM' will cause Python to delete 243 # the object when the garbage collector runs however this can take several seconds 244 # so we invoke the Python garbage collector manually here so we don't have to wait. 245 reporter.log('Invoking python garbage collection to trigger Machine::uninit() which will close the attached disks'); 246 try: 247 gc.collect(); 248 except: 249 reporter.logXcpt(); 247 250 248 251 cBaseImages = len(self.oTstDrv.oVBoxMgr.getArray(oVBox, 'hardDisks')); … … 328 331 oVM = None; 329 332 330 # Fudge factor: When unregistering a VM with CleanupMode_UnregisterOnly the 331 # associated medium objects will be closed when the Machine object is 332 # uninitialized so wait for that to complete. Otherwise the check for 333 # cBaseImages below will race with the VM uninitialization and depending on 334 # which one wins can cause a test failure. 335 reporter.log('Waiting five seconds for Machine::uninit() to be called to close the attached disks'); 336 time.sleep(5); 333 # When unregistering a VM with CleanupMode_UnregisterOnly the associated medium's 334 # objects will be closed when the corresponding Machine object ('oVM') is 335 # uninitialized. Assigning the 'None' object to 'oVM' will cause Python to delete 336 # the object when the garbage collector runs however this can take several seconds 337 # so we invoke the Python garbage collector manually here so we don't have to wait. 338 reporter.log('Invoking python garbage collection to trigger Machine::uninit() which will close the attached disks'); 339 try: 340 gc.collect(); 341 except: 342 reporter.logXcpt(); 337 343 338 344 cBaseImages = len(self.oTstDrv.oVBoxMgr.getArray(oVBox, 'hardDisks'))
Note:
See TracChangeset
for help on using the changeset viewer.