diff options
author | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2017-05-23 16:27:05 +0000 |
---|---|---|
committer | vboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f> | 2017-05-23 16:27:05 +0000 |
commit | cf1aab454a60a7efcb246931f8597fe5f66ce6e5 (patch) | |
tree | 760c735d93ebf00082dc1a3a7406040b0920f65a /src/VBox/ValidationKit/testdriver | |
parent | 994fa5fa465b88afac42b4105fc8ff7713e8c965 (diff) | |
download | VirtualBox-svn-cf1aab454a60a7efcb246931f8597fe5f66ce6e5.tar.gz |
ValidationKit: detect non-collectable VirtualBoxManager object (which generally is a victim of something else not being collectable due to cyclic references) and let someone know who is checking the logs
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@67048 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/ValidationKit/testdriver')
-rw-r--r-- | src/VBox/ValidationKit/testdriver/vbox.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/VBox/ValidationKit/testdriver/vbox.py b/src/VBox/ValidationKit/testdriver/vbox.py index 9c41e0b9277..fa75585e7ef 100644 --- a/src/VBox/ValidationKit/testdriver/vbox.py +++ b/src/VBox/ValidationKit/testdriver/vbox.py @@ -1407,6 +1407,21 @@ class TestDriver(base.TestDriver): try: import gc gc.collect(); + objects = gc.get_objects() + try: + try: + from types import InstanceType + except ImportError: + InstanceType = None # Python 3.x compatibility + for o in objects: + objtype = type(o) + if objtype == InstanceType: # Python 2.x codepath + objtype = o.__class__ + if objtype.__name__ == 'VirtualBoxManager': + reporter.log('actionCleanupAfter: CAUTION, there is still a VirtualBoxManager object, GC trouble') + break + finally: + del objects except: reporter.logXcpt(); self.fImportedVBoxApi = False; |